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

6 lines
193 B
JavaScript
Raw Normal View History

export function sumEven(value) {
// implementar logica aqui
2022-10-30 02:31:05 +00:00
return value.reduce((somaTotal, numeroAtual) => {
return numeroAtual % 2 == 0 ? somaTotal + numeroAtual : somaTotal
},0)
}