I have the following object:
[
{ id: 1 },
{ id: 2 },
{ id: 3 }
]
And I wanna add a another array but just to the last array of the object, always (the first object length can change). So, it might look like this:
New array element:
{ name: "Hello Id 3" }
First object with the the second one appended:
[
{ id: 1 },
{ id: 2 },
{ id: 3, name: "Hello Id 3" }
]
Any ideas?
Thanks in advance!