2022-10-27 11:07:13 -04:00
|
|
|
export function isPrime(value) {
|
2022-10-30 14:50:30 -03:00
|
|
|
let contador = 0;
|
|
|
|
for (let index = 0; index <= value; index++) {
|
|
|
|
if (value % index === 0) {
|
|
|
|
contador = contador + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (contador === 2) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|