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

11 lines
173 B
JavaScript
Raw Normal View History

export function isPrime(value) {
2022-11-02 20:18:08 +00:00
let divisor = 2;
while (value % divisor != 0) divisor++;
if (value == divisor) {
return true;
} else {
return false;
}
}