2022-10-27 15:07:13 +00:00
|
|
|
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
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|