I want to delete duplicate in array of objects but not as I found in stackoverflow questions,I want to check more than one property and verify that is not duplicate,for example :
const input = [
{
"eventUid": "0fdb73d9-629f-4151-acab-7b48c24ef2D0",
"name": "John",
"lastName": "Doe",
"city": "Ukraine",
},
{
"eventUid": "0fdb73d9-629f-4151-aBab-7b48c24ef2e0",
"name": "Marcel",
"lastName": "Pilate",
"city": "Ukraine",
},
{
"eventUid": "0fcc73d9-629f-4151-aBab-7b48c24ef2e0",
"name": "John",
"lastName": "Doe",
"city": "Ukraine",
}
]
Output shoukd be :
const input = [
{
"eventUid": "0fdb73d9-629f-4151-acab-7b48c24ef2D0",
"name": "John",
"lastName": "Doe",
"city": "Ukraine",
},
{
"eventUid": "0fdb73d9-629f-4151-aBab-7b48c24ef2e0",
"name": "Marcel",
"lastName": "Pilate",
"city": "Ukraine",
}
]
Because I want to check name,lastName and city for each element of the array, if there are duplicate then keep only the first. Have you any idea how to check that ?