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

15 lines
249 B
JavaScript
Raw Normal View History

export function isPrime(value) {
// implementar logica aqui
2022-10-28 18:35:28 +00:00
if(value == 2){
return true;
}
else if (value == 1){
return false
}
for(let i = 2; i < value; i++){
if(value % i == 0){
return false
}
}
return true;
}