Hello, its me again.
I’m having trouble wrapping my head on how to read the bracket notations and identifying the levels without editing the code for my ease of understanding/reading. I get that every time a new array is nested within another array, it’s indented - (it’s just a lot of brackets to read/understand from looking at it).
Using the exercise example (with my /**/ comments) for reference:
let nestedArray = [ /*LEVEL 1*/
/* LEVEL 2 - index 0 \*/
['deep'],
[
/* LEVEL 3 - index 1 */
['deeper'], ['deeper']
],
/* LEVEL 4 - index 2 */
[
[
['deepest'], ['deepest']
],
[
[
['deepest-est?'] /*LEVEL 5 - nestedArray[2][1][0][0][0] */
]
]
]
];
It wasn’t until I condensed it (see code below), was I able to understand that nestedArray[2][1][0][0][0] = ‘deepest-est?’
let nestedArray = [/*LEVEL 1*/
/* index 0 */
['deep'],
/* index 1 */
[ ['deeper'], ['deeper'] ],
/* index 2 */
[ [ ['deepest'], ['deepest'] ], [ [ ['deepest-est?'] ] ] ]
];
Do you guys have personal tips/tricks for making it easier to read the bracket notations for levels without having to edit the code as i did?? Or is it just something you just eventually pick up with time? How often will we see this if we were in real-life production?