2022-10-27 15:07:13 +00:00
|
|
|
export function isPrime(value) {
|
|
|
|
// implementar logica aqui
|
2022-10-29 02:51:11 +00:00
|
|
|
let div = 0;
|
|
|
|
let i;
|
|
|
|
for (i = 1; i <= value; i++) {
|
|
|
|
if ((value % i) == 0)
|
|
|
|
div++;
|
|
|
|
}
|
|
|
|
if (div === 2)
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false
|
2022-10-27 15:07:13 +00:00
|
|
|
|
|
|
|
}
|