forked from M3-Academy/challenge-algorithms-v2.0
14 lines
255 B
JavaScript
14 lines
255 B
JavaScript
export function sumEven(value) {
|
|
// implementar logica aqui
|
|
let soma = 0;
|
|
for (let number of value) {
|
|
if (value.length === 0) {
|
|
return 0;
|
|
} else
|
|
|
|
if (number % 2 === 0) {
|
|
soma = soma += number;
|
|
}
|
|
}
|
|
return soma;
|
|
} |