diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..5d8e1f4 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,25 @@ export function isPrime(value) { // implementar logica aqui - -} \ No newline at end of file + 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; +}