isPrime atualizado

This commit is contained in:
Nathalia Sardou 2022-10-30 00:33:17 -03:00
parent 74f51d2317
commit a37a8bbebe

View File

@ -1,4 +1,12 @@
export function isPrime(value) { export function isPrime(value) {
// implementar logica aqui // implementar logica aqui
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;
} }