feat(sum): algoritmo concluido

This commit is contained in:
Mateus Antonio Rodrigues Lopes 2022-11-02 20:13:46 -03:00
parent 6065ccf64c
commit b5637169b3

View File

@ -1,4 +1,8 @@
export function sum(values) {
// implementar logica aqui
}
// implementar logica aqui
let valorInicial = 0
return values.reduce(
(valorAnterior, valorAtual) => valorAnterior + valorAtual,
valorInicial
)
}