From 60c42f40223361e8f95f54bbf82021909e346dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorena=20Camila=20Coelho=20M=C3=A1ximo?= Date: Tue, 1 Nov 2022 00:42:23 -0400 Subject: [PATCH] =?UTF-8?q?feat(sumEven):=20desenvolvimento=20da=20fun?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 07-sumEven/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..bd20228 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,10 @@ export function sumEven(value) { // implementar logica aqui - + let total = 0; + for (let i = 0; i < value.length; i++) { + if (value[i] % 2 === 0) { + total += value[i]; + } + } + return total } \ No newline at end of file