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