2022-10-27 15:07:13 +00:00
|
|
|
export function isPrime(value) {
|
|
|
|
// implementar logica aqui
|
2022-10-31 16:55:02 +00:00
|
|
|
if (value === 0 || value === 1) return false;
|
2022-10-27 15:07:13 +00:00
|
|
|
|
2022-10-31 16:55:02 +00:00
|
|
|
for (let i = 2; i <= Math.sqrt(value); i++) {
|
|
|
|
if (value % i === 0) return false;
|
|
|
|
}
|
|
|
|
return true;
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|