diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..8355112 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,11 @@ export function sum(values) { // implementar logica aqui - + if (values.length === 0) { + return 0; + } else { + let soma = values.reduce(function (soma, i) { + return soma + i; + }); + return soma; + } } \ No newline at end of file