From 80fe435a5eafba1db76aeccae383fda7ce2cf109 Mon Sep 17 00:00:00 2001 From: Gabriel Ferraz Date: Fri, 28 Oct 2022 14:47:33 -0300 Subject: [PATCH] =?UTF-8?q?(isPrime):=20implementa=C3=A7=C3=A3o=20?= =?UTF-8?q?do=20c=C3=B3digo=20isPrime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05-isPrime/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..3d7d0c7 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,6 @@ export function isPrime(value) { // implementar logica aqui - + for (let div = 2; div < value; div++) + if (value % div == 0) return false; + return true; } \ No newline at end of file