From 00658561b1c404576d88be0eadb17391d48e85d9 Mon Sep 17 00:00:00 2001 From: Douglas Nobrega Date: Fri, 28 Oct 2022 17:40:31 -0300 Subject: [PATCH] desafio 03-concluido --- 03-maxValue/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/03-maxValue/index.js b/03-maxValue/index.js index e433b31..de72c41 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,10 @@ export function maxValue(values) { // implementar logica aqui - -} \ No newline at end of file + //Math.max.apply(null, values); outro método + if(values.length === 0) { + return 0 + } else { + return Math.max(...values); // método spred, vai espelhar a array e vai retorna o maior valor + } +} +