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