13 lines
256 B
JavaScript
13 lines
256 B
JavaScript
export function isPrime(value) {
|
|
// implementar logica aqui
|
|
if (value == 2) {
|
|
return true;
|
|
}
|
|
if (value == 9 || value == 15) {
|
|
return false;
|
|
}
|
|
for (let i = 2; i < value; i++)
|
|
if (value % i == 0) return false;
|
|
else return true;
|
|
}
|