forked from M3-Academy/challenge-algorithms-v2.0
8 lines
202 B
JavaScript
8 lines
202 B
JavaScript
export function sumEven(value) {
|
|
// implementar logica aqui
|
|
return value.filter((number) => {
|
|
if(number % 2 == 0) return number;
|
|
}).reduce((ac, number) => {
|
|
return ac += number;
|
|
}, 0);
|
|
} |