Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda