forked from M3-Academy/challenge-algorithms-v2.0
10 lines
219 B
JavaScript
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;
|
|
}
|