I want to add a key and value(i.e. age:15) to an object which has name as email and remove it(age) from other objects for the below array of object.
[
{
name: 'test',
lname: 'last',
age: 5
},
{
name: 'test1',
lname: 'last1',
age: 15
},
{
name: 'email',
lname: 'last',
},
]
i.e. I want the below output.
[
{
name: 'test',
lname: 'last'
},
{
name: 'test1',
lname: 'last1'
},
{
name: 'email',
lname: 'last',
age: 15
},
]
Thanks