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

11 lines
173 B
JavaScript

export function isPrime(value) {
let divisor = 2;
while (value % divisor != 0) divisor++;
if (value == divisor) {
return true;
} else {
return false;
}
}