forked from M3-Academy/challenge-algorithms-v2.0
Feat:Finalaizando SumEven
This commit is contained in:
parent
8f5230da66
commit
bc26939af9
@ -1,4 +1,14 @@
|
||||
export function sumEven(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
let Soma = 0
|
||||
for(let i = 0;i < value.length;i++){
|
||||
if(value === undefined){
|
||||
return 0
|
||||
}else{
|
||||
if(value[i] % 2 === 0){
|
||||
Soma = value[i] + Soma
|
||||
}
|
||||
}
|
||||
}
|
||||
return Soma
|
||||
}
|
Loading…
Reference in New Issue
Block a user