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

10 lines
219 B
JavaScript

export function sumEven(value) {
let somaPares = 0;
for (let index = 0; index < value.length; index++) {
if (value[index] % 2 === 0) {
somaPares = somaPares + value[index];
}
}
return somaPares;
}