feat(isPrime): adiciona funcao que verifica se o parametro e primo #5

Merged
ViniciusDeniz merged 1 commits from feature/isPrime into master 2022-11-02 20:59:13 +00:00

View File

@ -1,4 +1,25 @@
export function isPrime(value) {
// implementar logica aqui
}
let primo;
if (
number == 2 ||
number == 3 ||
number == 5 ||
number == 7 ||
number == 11 ||
number == 13
) {
primo = true;
} else {
primo =
number % 2 != 0 &&
number % 3 != 0 &&
number % 5 != 0 &&
number % 7 != 0 &&
number % 11 != 0 &&
number % 13 != 0
? "true"
: "false";
}
return primo;
}