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

121
Visualizações
Filtering an array based on presence of string value

I know filter questions are covered extensivly on SO - but I'm struggling to implement my idea:

I want to filter through my panels & return an array filteredPanelTabItems for any that include the layouthint: "tab-view-item" and then the remainder of the array (without "tab-view-item") to another const so I can use it elsewhere, can anyone guide where I'm going wrong?

enter image description here

The screenshot above shows what's happening in the console when I log: panel.panelLinks.links

  const hasTabItemViewHint() => {
    //check for string
  }

  const filteredPanelTabItems = panel.panelLinks.links.filter<Node>(
    (panelLink) => panelLink.(call hasTabItemViewHint function?)
  );
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Consider something like this.

var filteredPanelTabItems = $.map(panel.panelLinks.links, function(l, i) {
  if (l.LinkModal.layouthint._collections.indexOf("tab-view-item") >= 0) {
    return l;
  }
});

See more: https://api.jquery.com/jquery.map/

about 4 years ago · Juan Pablo Isaza Relatório
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