From cfb58393a4069527dfb3d9473afbd22cece6dfbf Mon Sep 17 00:00:00 2001 From: Sabrina Miranda Date: Sat, 29 Oct 2022 15:47:22 -0300 Subject: [PATCH] =?UTF-8?q?refactor:=20Muda=20vari=C3=A1vel=20Desafio=202.?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 03-maxValue/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/03-maxValue/index.js b/03-maxValue/index.js index cbc3564..e1aa3b2 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,12 +1,11 @@ export function maxValue(values) { - let valores = [...values]; - let maiorValor = valores[0]; + let maiorValor = values[0]; - if(valores.length === 0) { + if(values.length === 0) { maiorValor = 0; }else { - for(let i = 0 ; i < valores.length ; i++) { - let valor = valores[i]; + for(let i = 0 ; i < values.length ; i++) { + let valor = values[i]; if(valor > maiorValor) { maiorValor = valor;