diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..bebebf8 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,11 @@ export function isPrime(value) { // implementar logica aqui - + + let numberOfDivisors = 0 + for (let i = 1; i <= value; i++) { + if ((value % i) === 0) { + numberOfDivisors++; + } + } + return (numberOfDivisors === 2) ? true : false } \ No newline at end of file