2022-10-27 15:07:13 +00:00
|
|
|
export function isPrime(value) {
|
2022-10-28 21:09:53 +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
|
|
|
}
|