Tell us what’s happening:
So I understand this to en extent and I am able to pass.
My question revolves on the Nested Array, and how in the intro it says that the element = 11.
I am looking to see if someone can explain how this works
const element = arr[3][0][1]; would work out to be 11 in the …
const arr = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[[10, 11, 12], 13, 14]
];
I understand that 11 is in the sub array and in the nested array,
It is also in the position 3 in reference to the array that it is in
Its in the 2nd spot (aka 1) but I am confused on where the [0] fits in this arr= [3][0][1];?
like how does arr=[3][0][1]; equal 11???
Hopefully this explains my question and logic.
Your code so far
const myArray = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[[10, 11, 12], 13, 14],
];
const myData = myArray[2][1];
console.log(myData)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Access Multi-Dimensional Arrays With Indexes
Link to the challenge: