challenge-algorithms-v2.0-r.../05-isPrime/index.js

6 lines
175 B
JavaScript

export function isPrime(value) {
// implementar logica aqui
var start = 2;
while (start <= Math.sqrt(value)) if (value % start++ < 1) return false;
return value > 1;
}