From 8a86650b2888cc7533649d9d065b7b31b818aff6 Mon Sep 17 00:00:00 2001 From: Samuel Date: Thu, 27 Oct 2022 16:18:04 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Resolve=20o=20exerc=C3=ADcio=2003-maxVa?= =?UTF-8?q?lue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 03-maxValue/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/03-maxValue/index.js b/03-maxValue/index.js index e433b31..f2935e7 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,8 @@ export function maxValue(values) { // implementar logica aqui - + let res = Math.max(...values) + if (values.length === 0){ + return 0 + } + return res } \ No newline at end of file