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