I'd like to use the _.union
function to create a union of two arrays of objects. Union works with arrays of primitives only as it uses === to examine if two values are equal.
I'd like to compare objects using a key property: objects with the same key property would be regarded equal. Is there a nice functional way to achieve that ideally using lodash?
See Question&Answers more detail:os