development #11

Merged
SavioCarvalhoMoraes merged 20 commits from development into master 2022-10-30 18:40:05 +00:00
2 changed files with 12 additions and 7 deletions
Showing only changes of commit 2a58acc59d - Show all commits

View File

@ -5,7 +5,7 @@ Faça um algoritmo que retorne a soma de todos os números de um array
## Exemplo
```js
sum([1, 2, 3, 4, 5]) // 15
sum([10, 10, 10, 10]) // 40
sum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) // 55
```
sum([1, 2, 3, 4, 5]); // 15
sum([10, 10, 10, 10]); // 40
sum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); // 55
```

View File

@ -1,4 +1,9 @@
export function sumEven(value) {
// implementar logica aqui
}
let somaPares = 0;
for (let index = 0; index < value.length; index++) {
if (value[index] % 2 === 0) {
somaPares = somaPares + value[index];
}
}
return somaPares;
}