Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
Not appending empty cell in the first element of 2d array dynamically

I have created a function which will download excel. The scripts works perfectly fine. However, I am trying not to append "hello" in my temp array which is aoa

scripts and logic i came with are shown as below

        var aoa = new Array();
        for (let i = 0; i < filters.length; i++) {
        ..
        ..    
              for(let a = 0; a < filters[i].getAppliedValues().length;a++){ 
                    if(!aoa[a]) aoa[a] = ['Hello'];
                    aoa[a][i] = filters[i].getAppliedValues()[a].formattedValue;
                }
        ..
        ..    
        }

i have simplified my scripts on how i have declared my function .

The result i get is as shown in below image enter image description here

I have tried different approach on declaring if(!aoa[a]) aoa[a] = ['Hello']; but this will only return me an empty cell in the first column/row instead of not appending those into my temp array.

I believed the logic I declared on if(!aoa[a]) aoa[a] = new Array(); is wrong, anybody has any advice on what approach should I go with ?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda