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

14 lines
253 B
JavaScript

export function isPrime(value) {
// implementar logica aqui
if(value === 1){
return false
}else{
for(let divisor = 2; divisor < value; divisor++){
if((value%divisor === 0)){
return false
}
}
}
return true
}