If I have for example this array-variable:
var arr=[
[1,2,3]
[4,5,6]
]
How can I insert something in that array, for example like this:
arr=[
[1,2,3]
[4,5,6]
[7,8,9]
]
I tried arr=[arr,[7,8,9]] but then the [] are building up.
How to do this?
arr.push([7,8,9]);
That should do the trick. If you want to insert:
arr.splice(offset,0,thing_to_insert);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With