forked from M3-Academy/challenge-algorithms-v2.0
feat(07-sumEven): Adiciona função
This commit is contained in:
parent
b755e428f9
commit
b74587fc2f
@ -1,4 +1,11 @@
|
||||
export function sumEven(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
if (value.length === 0) return 0;
|
||||
let soma = 0;
|
||||
for(let i = 0; i < value.length; i ++){
|
||||
if(value[i] % 2 === 0){
|
||||
soma = soma + value[i];
|
||||
}
|
||||
}
|
||||
return soma;
|
||||
}
|
Loading…
Reference in New Issue
Block a user