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

203
Vistas
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
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