diff --git a/05-isPrime/index.js b/05-isPrime/index.js index 9412ea0..0880725 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,16 @@ export function isPrime(value) { // implementar logica aqui - + { if ( value === 1 ) { + return false; + } else if ( value === 2 ) { + return true; + } else { + for ( var x = 2; x < value; x++ ) { + if ( value % x === 0 ) { + return false; + } + } + return true; + } + } } \ No newline at end of file