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

10 lines
160 B
JavaScript

export function sumEven(value) {
let sum = 0;
for (let number of value) {
if(number % 2 === 0) {
sum += number;
}
}
return sum;
}