Simple array syntax in js

what does a[2][0] mean?

element 2 times element 0??

var a = [1,"2",[3]];

a.length; //3
a[0]; //1
a[2][0]; //3

Element 0 of the array in element 2 of the initial array.

the 1st element inside the 2nd element of a

is that correct?

The third element in the array a is another array (you can check this and this challenge for more on that), a is called a multi-dimensional array here, because it has another array inside it.

a[2][0]; is used to access an element in an array inside an array (a multi-dimensional array).

1 Like

thanks for the link!

1 Like