I am facing a situation where I have the given Array
[
{
"membershipId": "ckktojfvl2510541qu2xlfli79q",
"key": "ckkt9j5uq59711qu2hod0pgln",
"isUser": true,
"firstName": "Jennifer",
"lastName": "Lopez",
"name": "Jennifer Lopez",
"DOB": "12/31/1969",
"age": 51,
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f3999f9cb39e96dd909c9e">[email protected]</a>"
},
{
"membershipId": "ckotgsxdz107481p2vo6r0mb0l",
"key": "ckotgs3xo56081p2v2ek518pb",
"isUser": true,
"firstName": "Richard",
"lastName": "Rizk",
"name": "Richard Rizk",
"DOB": "Invalid date",
"age": "-",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="503e31343931103d357e333f3d">[email protected]</a>"
},
{
"membershipId": undefined,
"key": "ckothigbd244581p2vfy5tihls",
"isUser": false,
"firstName": "Profile",
"lastName": "Last",
"name": "Profile Last",
"DOB": "05/17/1986",
"age": 35,
"email": ""
}
]
This array comprises four objects, with two of them being similar in nature.
The task at hand is to eliminate the duplicate entry with membershipId set as UNDEFINED and retain the other instance.
Any assistance would be greatly appreciated!