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