feat(05-isPrime): Cria a função

This commit is contained in:
Leonardo Pereira Rocha 2022-10-28 20:53:25 -03:00
parent da3c5aab72
commit fbe17ccd07

View File

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