I'm trying to remove objectst from an array which have 4 identical values and 1 unique.
A quick google search gives a lot of options for removing identical objects from an array, but not objects that are similar.
Example of array:
var data = [
{Date: "2016-04-27T09:03:45Z", Name: "Tito", Title: "Developer", Department:"IT", Company: "XXX"},
{Date: "2016-04-27T08:07:45Z", Name: "Tito", Title: "Developer", Department:"IT", Company: "XXX"},
{Date: "2016-04-27T10:23:45Z", Name: "Tito", Title: "Developer", Department:"IT", Company: "XXX"}
]
I have tried using lodash _uniq
function, but it only takes one property to match:
var non_duplidated_data = _.uniq(data, 'Name');
All values are identical except date. How can I remove identical objects based on 4 properties?