From 5325173f4c28e2811229c704afd73c5f85bfc19a Mon Sep 17 00:00:00 2001 From: JoseGregorioMataRodriguez Date: Sat, 29 Oct 2022 00:51:11 -0200 Subject: [PATCH] =?UTF-8?q?feat:=20resolve=20func=C3=A3o=20isPrime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05-isPrime/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..bf896f6 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,14 @@ export function isPrime(value) { // implementar logica aqui + let div = 0; + let i; + for (i = 1; i <= value; i++) { + if ((value % i) == 0) + div++; + } + if (div === 2) + return true; + else + return false } \ No newline at end of file