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

10 lines
167 B
JavaScript

export function isPrime(value) {
// implementar logica aqui
let x = 0;
for(let i = 0; i <= value; i++)
if(value % i === 0)
x++;
return x === 2;
}