challenge-algorithms-v2.0-P.../05-isPrime/index.js
2022-10-30 15:23:32 -03:00

12 lines
318 B
JavaScript

export function isPrime(value) {
for (let divisor = 2; divisor < value; divisor++)
if (value % divisor === 0) {
return false;
}
return true;
/* for (var divisor = 2; divisor <= value; divisor++)
if (value % divisor == 0) return true;
else false; */
// implementar logica aqui 2 1 / 2
}