From 264b1a16607f79c6ab632494245a53bf92d47b77 Mon Sep 17 00:00:00 2001 From: danielmoliaribarbosa Date: Fri, 28 Oct 2022 15:03:13 -0300 Subject: [PATCH] =?UTF-8?q?feat(isPrime):=20Implementa=20fun=C3=A7=C3=A3o?= =?UTF-8?q?=20isPrime?= 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..d3d70d2 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,9 @@ export function isPrime(value) { // implementar logica aqui - + for (let x = 2; x < value; x++) { + if (value % x === 0 || value <= 1) { + return false; + } + } + return true; } \ No newline at end of file