I have a JS array:
a = ["a",["b","c"]]
How I can access string "b" in this array? Thank you very much!
You index into an array like this:
a[1][0]
Arrays are accessed using their integer indexes. Since this is an array inside an array, you use [1] to access the inner array, then get the first item in that array with [0].
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