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

17 lines
195 B
JavaScript

export function isPrime(value) {
if(value <= 1){
return false;
}
for (let i = 2; i < value; i++ ){
if (value % i === 0) {
return false;
}
}
return true;
}