diff --git a/03-maxValue/index.js b/03-maxValue/index.js index e433b31..bd5b22d 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,13 @@ export function maxValue(values) { - // implementar logica aqui - -} \ No newline at end of file + let max = values[0]; + if (values.length === 0) { + return 0; + } else { + for (let index = 0; index <= values.length; index++) { + if (max < values[index]) { + max = values[index]; + } + } + return max; + } +}