feat: Algoritmo 05-isPrime - finalizado

This commit is contained in:
José Carlos Lins 2022-10-27 20:14:32 -03:00
parent a55909d38f
commit 9b98258cab

View File

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