forked from M3-Academy/challenge-algorithms-v2.0
17 lines
232 B
JavaScript
17 lines
232 B
JavaScript
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;
|
|
} |