feat(isPrime): fazendo funcão

This commit is contained in:
Caroline Moran 2022-10-28 07:36:27 -04:00
parent 7536d3d99d
commit 7801380351

View File

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