feat(isPrime): Feito quinto exercício

This commit is contained in:
Vinícius Gabriel 2022-10-28 08:00:31 -03:00
parent 76f4cfb337
commit 248abe8613

View File

@ -1,4 +1,15 @@
export function isPrime(value) {
// implementar logica aqui
let prime;
let cont = 0;
for (let i = 0; i <= value; i++) {
if (value % i === 0) {
cont++;
}
}
if (cont > 2) {
return false;
} else {
return true;
}
}