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

11 lines
198 B
JavaScript
Raw Normal View History

export function isPrime(value) {
2022-10-28 22:09:14 +00:00
if(value == 1) return false;
for(let divisor = 2 ; divisor < value ; divisor++) {
if(value % divisor == 0) {
return false;
}
}
return true;
}