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

10 lines
203 B
JavaScript
Raw Normal View History

export function isPrime(value) {
// implementar logica aqui
2022-10-27 19:52:08 +00:00
if (value === 1) {
return false
}
for (let p = 2; p < value; p++)
if (value % p === 0) {
return false
} return true
}