2022-10-27 15:07:13 +00:00
|
|
|
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;
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|