I am working with the following array structure:
{"succees":false,"message":"","success":true,"customers":
[{"id_customers":2,
"code_customers":"123444444",
"trade_name":"world",
}
]},
[{"id_customers":1,
"code_customers":"4444",
"trade_name":"hello",
}
]}
}
My question is, how can I add a new element to every object in this array?
The desired structure after adding the new element should look like this:
{"succees":false,"message":"","success":true,"customers":
[{"id_customers":2,
"code_customers":"123444444",
"trade_name":"world",
"collapse":true, // The new element
}
]},
[{"id_customers":1,
"code_customers":"4444",
"trade_name":"hello",
"collapse":true, // The new element
}
]}
}
I am using Angular for this task but unsure of the approach to take. Any guidance or assistance would be appreciated.
Thank you!