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

123
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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