diff --git a/03-maxValue/index.js b/03-maxValue/index.js index 101103f..2c7394d 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,8 @@ export function maxValue(values) { // implementar logica aqui + if (values.length == 0) { + return 0 + } return Math.max(...values); + } \ No newline at end of file diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..a278fe5 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,8 @@ export function sum(values) { // implementar logica aqui - + let soma = 0 + for (let index = 0; index < values.lenght; index += 1) { + soma = soma + values[index]; + } + return soma; } \ No newline at end of file