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

10 lines
203 B
JavaScript

export function isPrime(value) {
// implementar logica aqui
if (value === 1) {
return false
}
for (let p = 2; p < value; p++)
if (value % p === 0) {
return false
} return true
}