From d53e5614be8ef15f2e2c21770484fb030c012bba Mon Sep 17 00:00:00 2001 From: ednabarboza Date: Fri, 28 Oct 2022 08:34:59 -0300 Subject: [PATCH] feat(home):resolucao da questao 3 --- 03-maxValue/index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/03-maxValue/index.js b/03-maxValue/index.js index e433b31..a542f73 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,12 @@ export function maxValue(values) { - // implementar logica aqui - -} \ No newline at end of file + //OBS: Questão foi realizada com função Math.max() que retorna o maior de um ou mais números. + //Referência: Usei como base o material descrito na página do Mozilla, + //disponível em: https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Math/max + //Acesso em: 24/10/2022 + if(values.length === 0){ + return 0 + }else{ + return Math.max.apply(null, values); + } + + };