challenge-algorithms-v2.0-n.../07-sumEven/index.js

8 lines
213 B
JavaScript
Raw Normal View History

export function sumEven(value) {
// implementar logica aqui
2022-10-28 18:04:27 +00:00
const numerosPares = value.filter(valor => (valor % 2) == 0)
return numerosPares.reduce((somatorio, par) => {
return somatorio + par
}, 0)
}