feat: criar algoritmo que realize a soma dos valores contidos na array

This commit is contained in:
HUMBERTO ANTONIO CORREIA FERRO 2022-10-29 08:48:20 -03:00
parent 31c440491f
commit 53eee52952

View File

@ -1,4 +1,9 @@
export function sum(values) { export function sum(values) {
// implementar logica aqui // implementar logica aqui
var soma = 0;
for (var i = 0; i < values.length; i++) {
soma += values[i];
}
return soma;
} }