forked from M3-Academy/challenge-algorithms-v2.0
feat(isPrime): Responde função 05
This commit is contained in:
parent
c4e8de1c15
commit
0de9bd577c
@ -1,4 +1,16 @@
|
||||
export function isPrime(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
{ if ( value === 1 ) {
|
||||
return false;
|
||||
} else if ( value === 2 ) {
|
||||
return true;
|
||||
} else {
|
||||
for ( var x = 2; x < value; x++ ) {
|
||||
if ( value % x === 0 ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user