forked from M3-Academy/challenge-algorithms-v2.0
5 lines
146 B
JavaScript
5 lines
146 B
JavaScript
export function isPrime(value) {
|
|
var start = 2;
|
|
while (start <= Math.sqrt(value)) if (value % start++ < 1) return false;
|
|
return value > 1;
|
|
} |