Looking at the image below, I have some json data
that consists of three objects; each containing a client's id => data.
exact_match : {104}
match_4 : {104, 103}
match_2 : {104, 103, 68}
Is there a way to remove duplicate objects based on previous ones? For example:
exact_match : {104}
match_4 : {103}
match_2 : {68}
I attempted to use _.difference but it didn't work (Possibly because it is designed for arrays rather than objects):
var exact_match = data.exact_match,
match_four_digits = _.difference(data.match_4, data.exact_match),
match_two_digits = _.difference(data.match_2, data.exact_match, data.match_4),
Any assistance would be greatly appreciated :)
Update
I require that the returned value maintains the same object data instead of generating a new array :)