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