From 4f1db060f4cdd574493e2533ba9df165b78b4700 Mon Sep 17 00:00:00 2001 From: Matheus Date: Wed, 2 Nov 2022 11:52:22 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20cria=C3=A7=C3=A3o=20da=20respopsta=20do?= =?UTF-8?q?=2005-isPrime?= 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..18936a8 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,9 @@ export function isPrime(value) { // implementar logica aqui - + for (let index = 2; index < value; index++) { + if (value % index === 0) { + return false + } + } + return value > 1; } \ No newline at end of file