From 2415e944a03e7c640efed7db1fefc9a1c2017ceb Mon Sep 17 00:00:00 2001 From: Nicolas Oliveira <110689312+thedevnicolas@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:42:47 -0300 Subject: [PATCH] feat(desafio07):desafio-completo --- 07-sumEven/index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..8fff8f4 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,13 @@ export function sumEven(value) { // implementar logica aqui - -} \ No newline at end of file + const newArray = value; + var i; + let total = 0; + + for (i = 0; i < newArray.length; i++) { + if (newArray[i] % 2 === 0) { + total = total + newArray[i]; + } + } + return total; +} \ No newline at end of file