I'm currently developing an Angular application and I have an array named "*identify duplicates" that looks like the following:
[
{
Name: "Jack",
Id: "1"
},
{
Name: "Rose",
Id: "2"
},
{
Name: "Jack",
Id: "4"
},
{
Name: "Jack",
Id: "4"
}
]
My goal is to remove duplicate entries in the array based on both the name and id. For example, in the last two indexes of the array, the name and id are the same for "Jack", so I want to delete these duplicates. However, I do not want to delete data if the names are the same but the ids are different. In the above example, I would like to keep the entry for Jack with the id "1" in my array, but remove the last two entries for Jack with the id "4". How can I achieve this?