Merge pull request 'feat(isPrime): adiciona funcao que verifica se o parametro e primo' (#5) from feature/isPrime into master

Reviewed-on: #5
This commit is contained in:
ViniciusDeniz 2022-11-02 20:59:13 +00:00
commit f3c0414b2f

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;
}