diff --git a/03-maxValue/index.js b/03-maxValue/index.js index 80a0e79..9a077ba 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,5 +1,4 @@ export function maxValue(values) { // implementar logica aqui - - return Math.max(null,values); + return Math.max.apply(null, values) } diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..26a322f 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,10 @@ export function sum(values) { // implementar logica aqui + var arr = values; + var soma = 0; + for (var i = 0; i < arr.length; i++) { + soma +=arr[i] + } + return soma; } \ No newline at end of file