feat: implementa função isPrime

This commit is contained in:
RodrigoJorge 2022-10-28 15:35:28 -03:00
parent 63fd0f2dda
commit ed34bb7d8e

View File

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