How to read an array in an array


#1

How would you read an array in an array?
for example:
[[1,2,3], [3,2,1]]
if I have an array like this, how would I read the number in position 0 in the array in position 1?
( [[1,2,3],[3,2,1]] the one that is bold/strong )


#2

The 3 in the first array would be accessed like this:

arrayName[0][2]

You can try things in labs repl.it

  arrayName = [[1,2,3], [3,2,1]];
=> [ [ 1, 2, 3 ], [ 3, 2, 1 ] ]
   console.log(arrayName[0][2]);
3
    

#3

makes sense, thanks very much! :grinning: