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

205
Views
How to find intersection of objects in separate lists in JavaScript?

In JavaScript, on two lists of objects, I would like to identify which objects in each list have the the same property value, say "USDT-WETH". My initial way of approaching this was to create a map (key/value array) with the key, "USD-WETH", then populate an array of filtered, matching objects.

I'd like to explore other options. For example, given n-number of lists/arrays/collections, we'll look for a common value, "WETH".

map["exch1"] = an array or list of objects that contain pool.token0.symbol and pool.token1.symbol
map["exch2"] = an array or list of objects that contain pool.token0.symbol and pool.token1.symbol
map["exch3"] = an array or list of objects that contain pool.token0.symbol and pool.token1.symbol
map["exch4"] = an array or list of objects that contain pool.token0.symbol and pool.token1.symbol

Now I would like to pick out which array elements in each where pool.token0.symbol or pool.token1.symbol contains "WETH".

I could create a for loop to traverse the collections, and pick out the common objects to put them into a separate list, but I would like to know of a more efficient way of doing this in JS, please.

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!