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.