I currently have an array for a multiplayer web game that looks like so:
[
[
"<some value>",
"<some value>",
"<some value>",
[
[
<some value>,
<some value>,
<some value>,
<some value>
]
]
]
]
So the myArray[0][2][0] holds info about 1 player.
I use the following code
var TempPlayerArrayToAdd = [<some value>, <some value>, <some value>, <some value>];
myArray[0][2].push(TempPlayerArrayToAdd);
But this results into the error that .push is not a function and I cannot figure out how to use it properly even after checking MDN docs.
The desired result would be
[
[
"<some value>",
"<some value>",
"<some value>",
[
[
<some value>,
<some value>,
<some value>,
<some value>
],
[
<some value>,
<some value>,
<some value>,
<some value>
]
]
]
]
Thanks for your time :)
myArray[0][3].push(TempPlayerArrayToAdd);:) I think you may have miscounted the number of elements in your arraymyArray[0][3], If you still have doubt you can take a look at the example here codepen.io/Maniraj_Murugan/pen/poJWadO