From 0fced579fea1b6059cc6e24688a6f48899d9c8ce Mon Sep 17 00:00:00 2001 From: ThiagoDuutra Date: Fri, 28 Oct 2022 17:01:11 -0300 Subject: [PATCH] feat: Resolvido questao sumEven --- 07-sumEven/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..e9da896 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,10 @@ export function sumEven(value) { // implementar logica aqui - -} \ No newline at end of file + let somaPar = 0; + for (let i = 0; i < value.length; i++) { + if (value[i] % 2 === 0) { + somaPar += value[i]; + } + } + return somaPar; +}