From 0618ad9863aac32ee29fc3820aa39209713d87c1 Mon Sep 17 00:00:00 2001 From: Nicolly Vieira Date: Fri, 28 Oct 2022 15:04:27 -0300 Subject: [PATCH] feat(sumEven): funcao feita --- 07-sumEven/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..7bd8ff9 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,8 @@ export function sumEven(value) { // implementar logica aqui - + const numerosPares = value.filter(valor => (valor % 2) == 0) + + return numerosPares.reduce((somatorio, par) => { + return somatorio + par + }, 0) } \ No newline at end of file -- 2.34.1