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