Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!