From f371a727ad00e2cf5343f8338ba76e12af1415cb Mon Sep 17 00:00:00 2001 From: alecapra96 Date: Wed, 13 Jan 2021 12:13:07 -0300 Subject: [PATCH] arregle el bucle infinito --- grupoFamiliar.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/grupoFamiliar.js b/grupoFamiliar.js index 2fbc520..d671305 100644 --- a/grupoFamiliar.js +++ b/grupoFamiliar.js @@ -2,7 +2,7 @@ let $buttonNext = document.getElementById("buttonNext"); let $placeImputs=document.getElementById("secondPart"); // let $buttonNext2=document.getElementById("click-button-next"); let $buttonMore; - +let arrayGenerado = [] ; $buttonNext.addEventListener("click",ocultarInicio); $buttonNext.addEventListener("click",ShowsInputsCreated); @@ -28,16 +28,14 @@ function ShowsInputsCreated(){ //Muestra imputs de acuerdo al numero que escribi function CalcularPromedio(){ let verArray= [] ; let $imputsGenerados = Array.from(document.getElementsByClassName("inputsGenerados")); - console.log($imputsGenerados); - console.log(verArray); - + for (i=0;i<$imputsGenerados.length;i++) { - let verArray = $imputsGenerados[i]; - $imputsGenerados.push(verArray); + verArray = $imputsGenerados[i]; + arrayGenerado.push(verArray.value); } - console.log($imputsGenerados); - + console.log(arrayGenerado); + return arrayGenerado; }