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

12 lines
199 B
JavaScript
Raw Normal View History

export function sumEven(value) {
2022-10-28 12:10:49 +00:00
let inicio = 0
for(let i=0; i< value.length; i++){
if(value[i] % 2 === 0){
inicio = inicio + value[i]
}
}
return inicio
}