diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..2aa5e6a 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,15 @@ export function sumEven(value) { // implementar logica aqui - -} \ No newline at end of file + const arr = []; + for (let index = 0; index < value.length; index++) { + const element = value[index]; + if (element % 2 == 0) { + arr.push(element); + } + } + function add(a, b) { + return a + b; + } + var soma = arr.reduce(add, 0); + return soma; +}