From 1176d331b22718921985bf6ae41012b68fb79a7f Mon Sep 17 00:00:00 2001 From: Eleonora Otz Date: Fri, 28 Oct 2022 16:16:49 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Soluciona=20o=20exerc=C3=ADcio=2005=20-?= =?UTF-8?q?=20Is=20prime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05-isPrime/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..17a08cf 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 + }; + + return value > 1; } \ No newline at end of file