Hey! Is there any built in method similar to .associateBy on arrays, but instead of associating the last value related to the thing you're associating by, to be able to pass a specific comparator and only replace it if it fulfils the condition?
So right now, if we were to associate [{a:1, b:2}, {a:1, b:3}] basing ourselves on the value of a, the final value would be of the map would be {1: {a: 1, b:3}}, but maybe I would like to compare b and only replace if b < new b.
Hope I made myself clear! Thanks for any help!