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

11 lines
217 B
JavaScript

export function sumEven(value) {
// implementar logica aqui
let resultEvenSum = 0;
value.forEach(element => {
if ((element % 2) === 0) {
resultEvenSum += element;
}
});
return resultEvenSum;
}