feat(challenge): desafio isPrime finalizado

This commit is contained in:
Thiago Bronisio 2022-10-29 00:00:04 -03:00
parent 939cb3999f
commit dd4bb24b52

View File

@ -1,4 +1,14 @@
export function isPrime(value) {
// implementar logica aqui
let divisores = 0;
for (let i = 1; i <= value; i++) {
if (value % i == 0) {
divisores++;
}
}
let isPrimoNotPrimo = (divisores == 2) ? true : false;
return isPrimoNotPrimo;
}