I have an array of objects like this -
var arr = [
{ type_id: "3", full_empty:"true", quantity:1},
{ type_id: "3", full_empty:"true", quantity:1},
{ type_id: "9", full_empty:"true", quantity:4},
{ type_id: "9", full_empty:"false", quantity:4},
{ type_id: "9", full_empty:"true", quantity:4},
{ type_id: "9", full_empty:"true", quantity:4},
{ type_id: "9", full_empty:"true", quantity:4}
];
I want to remove the duplicates having same type_id and full_empty values. The result should look like this -
var arr = [
{ type_id: "3", full_empty:"true", quantity:1},
{ type_id: "9", full_empty:"true", quantity:4},
{ type_id: "9", full_empty:"false", quantity:4},
];
I have searched and found some solution, but some of them are for removing duplicate keys or for removing duplicates based on duplicate value of only one key. Some required external libraries. Also there are some solutions which i can't understand. Is there any easy way to do this in plain JavaScript ?
Edit for better understand - I have read this question . Accepted answer on that question is for finding duplication for only one key. In my case, I have to find the duplication for multiple keys.