From 0f4862a8d5dabc83f4c63d6d2ce4843077827662 Mon Sep 17 00:00:00 2001 From: Carlos Scantbelruy Date: Fri, 28 Oct 2022 08:09:55 -0400 Subject: [PATCH] retornando se o numero e primo --- 05-isPrime/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..4c3b504 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,5 @@ export function isPrime(value) { - // implementar logica aqui - -} \ No newline at end of file + for (var i = 2; i < value; i++) + if (value % i === 0) return false; + return value !== 1; + }