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

89
Views
How to find all entries with matching IDs between two objects in React?

I'm dealing with two objects formatted like this.

   {
        "MediaListCollection": {
            "lists": [
                {
                    "entries": [
                        {
                            "mediaId": 121,
                            "score": 0
                        },
                        {
                            "mediaId": 5114,
                            "score": 10
                        }
    }

I want to make a new object with all of the entries that appear in both objects (using mediaID as a key). I tried this code but apparently it doesn't work in React because filter is only used on arrays, not objects:

const sameShows = user1Shows.filter(user1Shows.filter(shows1 => user2Shows.some(shows2 => user1Shows.mediaID === user2Shows.mediaID)))

Using Object.entries(user1shows) doesn't fix the problem. I get a [object Array] is not a function error.

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