From aab21161ae964e1f26745f1a8a38dfc3d4f7bb59 Mon Sep 17 00:00:00 2001 From: Matheus Date: Wed, 2 Nov 2022 11:43:27 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20cria=C3=A7=C3=A3o=20da=20resposta=20do?= =?UTF-8?q?=2003-maxValue?= 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..8b8073a 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,8 @@ export function maxValue(values) { // implementar logica aqui - + let maiorNumero = Math.max(...values); + if (values.length === 0) { + return maiorNumero=0 + } else {}; + return maiorNumero ; } \ No newline at end of file