diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..13fcebf 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,14 @@ export function sum(values) { // implementar logica aqui + let soma = 0 + + if(values.length == 0) return 0 + + for (let i = 0; i < values.length; i++) { + soma += values[i] + } + return soma -} \ No newline at end of file +} + +sum([1, 2, 3, 4, 5]) \ No newline at end of file