forked from M3-Academy/challenge-algorithms-v2.0
22 lines
361 B
JavaScript
22 lines
361 B
JavaScript
export function sumEven(value) {
|
|
// implementar logica aqui
|
|
|
|
var soma = 0
|
|
|
|
for (var cont = 0; cont < value.length; cont++) {
|
|
|
|
|
|
if (value[cont] % 2 == 0)
|
|
|
|
soma = soma + value[cont]
|
|
|
|
|
|
}
|
|
|
|
return soma
|
|
|
|
|
|
|
|
|
|
|
|
} |