From 89b65c171e776e762b9687364ee3b7e8547715e6 Mon Sep 17 00:00:00 2001 From: WellingtonWDS Date: Tue, 1 Nov 2022 08:55:24 -0300 Subject: [PATCH] feat(maxValue) Implementacao da funcao maxValue --- 03-maxValue/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/03-maxValue/index.js b/03-maxValue/index.js index e433b31..b4b1259 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,11 @@ export function maxValue(values) { - // implementar logica aqui + + if(values.length < 1){ + return 0; + } + + let maior = Math.max.apply(null, values) + + return maior; } \ No newline at end of file