From 540753a969b000944d8f60421e3409c1d30b79d3 Mon Sep 17 00:00:00 2001 From: Gabriel Bernardini Date: Sat, 29 Oct 2022 12:38:13 -0300 Subject: [PATCH] =?UTF-8?q?feat(sumeven):aplicando=20a=20fun=C3=A7=C3=A3o?= =?UTF-8?q?=20ao=20teste=207?= 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..c458bdb 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,10 @@ export function sumEven(value) { // implementar logica aqui - + let soma = 0; + for (let i = 0; i < value.length; i++){ + if (value[i] % 2 == 0){ + soma += value[i]; + } + } + return soma; } \ No newline at end of file