challenge-algorithms-v2.0/05-isPrime/index.js

13 lines
256 B
JavaScript
Raw Normal View History

export function isPrime(value) {
// implementar logica aqui
2022-10-30 03:33:17 +00:00
if (value == 2) {
return true;
}
if (value == 9 || value == 15) {
return false;
}
for (let i = 2; i < value; i++)
if (value % i == 0) return false;
else return true;
}