forked from M3-Academy/challenge-algorithms-v2.0
11 lines
242 B
JavaScript
11 lines
242 B
JavaScript
export function isPrime(value) {
|
|
// implementar logica aqui
|
|
|
|
let numberOfDivisors = 0
|
|
for (let i = 1; i <= value; i++) {
|
|
if ((value % i) === 0) {
|
|
numberOfDivisors++;
|
|
}
|
|
}
|
|
return (numberOfDivisors === 2) ? true : false
|
|
} |