Hey, I'm trying to figure out how to remove duplicate entries from an array where the UserId values are the same, and keep only one of each unique entry. Can anyone help me with this?
For example:
a=[
{userId:1,name:''},
{userId:2,name:''},
{userId:3,name:''},
{userId:1,name:''},
{userId:1,name:''}
]
Result should be:
a=[
{userId:1,name:''},
{userId:2,name:''},
{userId:3,name:''}
]