forked from M3-Academy/challenge-algorithms-v2.0
13 lines
234 B
JavaScript
13 lines
234 B
JavaScript
export function isPrime(value) {
|
|
// implementar logica aqui
|
|
if(value == 0 || value == 1) {
|
|
return false
|
|
}
|
|
|
|
for(let div = 2; div <= Math.sqrt(value); div++){
|
|
if(value % div == 0) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
} |