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

8 lines
202 B
JavaScript
Raw Normal View History

export function sumEven(value) {
// implementar logica aqui
2022-10-28 15:00:57 +00:00
return value.filter((number) => {
if(number % 2 == 0) return number;
}).reduce((ac, number) => {
return ac += number;
}, 0);
}