challenge-algorithms-v2.0-j.../05-isPrime/index.js

17 lines
232 B
JavaScript
Raw Permalink Normal View History

export function isPrime(value) {
// 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;
}