From 1cb7fb712c15494a989a90161402bfc5371ce9eb Mon Sep 17 00:00:00 2001 From: Gabriel Bernardini Date: Sat, 29 Oct 2022 12:29:19 -0300 Subject: [PATCH] =?UTF-8?q?feat(isprime):aplicando=20a=20fun=C3=A7=C3=A3o?= =?UTF-8?q?=20no=20teste=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05-isPrime/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..51810f8 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,10 @@ export function isPrime(value) { // implementar logica aqui - + if (value < 2) return false + for (let i = 2; i < value; i++) { + if (value % i == 0){ + return false + } + } + return true } \ No newline at end of file