Calling data from a 2d array


#1


Just learned about 2D arrays, however unless ive missed something, i haven't been taught how to call up the data from within the array. In the example code below, i want to console.log the number 5. The console.log underneath was my attempt at doing so, however i get 'undefined' instead of the number. Can anyone explain this to me? I really dont want to move on until i understand this.


var jagged = [[1,2,3], [4,5], 6]
console.log (jagged[1[1]])


#2

Hi this part

jagged[1[1]])

should be like that

jagged[1][1])

In this case the first number [1] will select [4, 5] then the second number [1] will select the number 5


#3

I knew it would be something simple. Thank you for your help :slight_smile: