05-resolvido

This commit is contained in:
Emilly Schuenck de Lima 2022-11-01 13:53:50 -03:00
parent 518eecfc7c
commit ba9a44473d

View File

@ -1,4 +1,18 @@
export function isPrime(value) { export function isPrime(value) {
// implementar logica aqui // implementar logica aqui
let TotalDeivisores = 0;
for (let i = 1; i <= value; i++) {
if (value % i == 0) {
TotalDeivisores++
}
}
if (TotalDeivisores == 2){
return true;
} else return false;
if (value === 2){
return true;
}
if (value === 1){
return false;
}
} }