feat(isPrime): algoritmo criado.

This commit is contained in:
Luiz Felipe Silva 2022-10-31 22:24:41 -03:00
parent db7e485577
commit 24299f9c26

View File

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