2022-10-27 15:07:13 +00:00
|
|
|
export function isPrime(value) {
|
2022-10-28 11:00:31 +00:00
|
|
|
let prime;
|
|
|
|
let cont = 0;
|
|
|
|
for (let i = 0; i <= value; i++) {
|
|
|
|
if (value % i === 0) {
|
|
|
|
cont++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cont > 2) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|