2022-10-27 15:07:13 +00:00
|
|
|
export function isPrime(value) {
|
2022-11-02 17:50:03 +00:00
|
|
|
var numero = parseInt(value);
|
|
|
|
var divisores = 0;
|
|
|
|
|
|
|
|
for (var count = 1; count <= numero; count++)
|
|
|
|
if (numero % count == 0) divisores++;
|
|
|
|
|
|
|
|
if (divisores == 2) return true;
|
|
|
|
else return false;
|
|
|
|
}
|