I have the below array
const values = [
{
name: 'A',
age: 12
},
{
name: 'B',
age: 1
},
{
name: 'A',
age: 31
}
]
and I want using lodash remove an object from this array that has the same name, so it should return:
const values = [
{
name: 'A',
age: 12
},
{
name: 'B',
age: 1
}
]
Using
_.uniqWith(_.isEqual, values)
only remove duplicate if the whole object is duplicated ... How can I remove using property?