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