forked from M3-Academy/challenge-algorithms-v2.0
11 lines
236 B
JavaScript
11 lines
236 B
JavaScript
export function isPrime(value) {
|
|
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;
|
|
}
|