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

20 lines
387 B
JavaScript
Raw Normal View History

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