challenge-algorithms-v2.0-d.../05-isPrime/index.js
2022-10-28 18:48:15 -03:00

8 lines
181 B
JavaScript

export function isPrime(value) {
// implementar logica aqui
for(let i=2;i <= Math.sqrt(value);i++){
if(value % i == 0 || value < 2)
return false;
}
return true
}