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