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

142
Views
how to iterate over every item in items, search for corresponding member in members

I need to create a function that will sort members so that they be in the same order as items. I need to iterate over every item in items, search for the corresponding member in members, and create a new member list. Then I need to call setMembers and pass the newly created member list.

function sortMemberList(items) {
const membersCopy = .slice(items);
membersCopy.sort((a, b) => a.dataset.id.localeCompare(b.dataset.id));
setMembers(membersCopy);

}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could use .filter:

const filteredMembers = membersCopy.filter(member => member.property === value)
setMembers(filteredMembers)
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!