Reputation: 325
I have an object and need to change phone in Sidney into '1111', and in NY into '2222'. How can I do it?
data = {
order: 1,
name: 'John',
address: [
{
order: 1,
name: 'Sidney',
phone: '000',
},
{
order: 2,
name: 'NY',
phone: '000',
}, ], }
I tried to use map as **data.address.map((item) => )**
but do not know how to change both variant simultaneously and add to data.
Upvotes: 0
Views: 32