Tell us what’s happening:
I added an array and don't understand why nestedArray[0][1] doesn't print deep1. I wanted to make sure I was understand the concept by logging to the console all the possible values. When I added deep1 it doesn't print although deep does print nestedArray[0][0].
Your code so far
let nestedArray = [ // top, or first level - the outer
['deep'],['deep1'], // an array within an array, 2
[
['deeper'], ['deeper2'] // 2 arrays nested 3 levels deep
],
[
[
['deepest1'], ['deepest2'] // 2 arrays nested 4 levels
],
[
[
['deepest-est?'],["deepest-est1"] // 5
]
]
]
];
console.log(nestedArray[0][1]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays