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