feat: resolve funcão isPrime

This commit is contained in:
José Gregorio Mata Rodríguez 2022-10-29 00:51:11 -02:00
parent 33405f4457
commit 5325173f4c

View File

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