From bc26939af95b3794164adf9885f2bc5cd3c3c1c9 Mon Sep 17 00:00:00 2001 From: Gustavo_Rallenson Date: Fri, 28 Oct 2022 21:28:26 -0300 Subject: [PATCH] Feat:Finalaizando SumEven --- 07-sumEven/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..a92be14 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,14 @@ export function sumEven(value) { // implementar logica aqui - + let Soma = 0 + for(let i = 0;i < value.length;i++){ + if(value === undefined){ + return 0 + }else{ + if(value[i] % 2 === 0){ + Soma = value[i] + Soma + } + } + } + return Soma } \ No newline at end of file