forked from M3-Academy/challenge-algorithms-v2.0
16 lines
384 B
JavaScript
16 lines
384 B
JavaScript
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;
|
|
}
|
|
}
|
|
} |