From b74587fc2f0a87bbdbfefd52398d3b7b986c04e7 Mon Sep 17 00:00:00 2001 From: Emerson Fully <63175980+emersonfully@users.noreply.github.com> Date: Sat, 29 Oct 2022 17:21:49 -0300 Subject: [PATCH] =?UTF-8?q?feat(07-sumEven):=20Adiciona=20fun=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 07-sumEven/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..1233b25 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,11 @@ export function sumEven(value) { // implementar logica aqui - + if (value.length === 0) return 0; + let soma = 0; + for(let i = 0; i < value.length; i ++){ + if(value[i] % 2 === 0){ + soma = soma + value[i]; + } + } + return soma; } \ No newline at end of file