Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda