From bd7262fc36653df030277e1aa16f7679ad738c9c Mon Sep 17 00:00:00 2001 From: Samuel Date: Thu, 27 Oct 2022 17:32:13 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Resolve=20o=20exerc=C3=ADcio=2007-sumEv?= =?UTF-8?q?en?= 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..0395674 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,10 @@ export function sumEven(value) { // implementar logica aqui - + let add = 0 + for (let i = 0; i < value.length; i++) { + if (value[i] % 2 === 0) { + add = add + value[i] + } + } + return add } \ No newline at end of file