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

15 lines
241 B
JavaScript

export function sumEven(values) {
// implementar logica aqui
let soma = 0
for (let index = 0; index < values.length; index++) {
if (values[index] % 2 === 0) {
soma += values[index]
}
}
return soma
}