Basic Data Structures #12: Create complex multi-dimensional arrays

Tell us what’s happening:

(remember, the outer-most array is level 1)

Why is this so, if arrays use zero-based indexing?

  **Your code so far**
let myNestedArray = [
// Only change code below this line
['unshift', false, 1, 2, 3, 'complex', 'nested'],
['loop', 'shift', 6, 7, 1000, 'method'],
['concat', false, true, 'spread', 'array'],
['mutate', 1327.98, 'splice', 'slice', 'push'],
['iterate', 1.3849, 7, '8.4876', 'arbitrary', 'depth']
// Only change code above this line
];
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36

Challenge: Create complex multi-dimensional arrays

Link to the challenge:

The depth is not an index

But I imagine there can be an argument on using 0-based counting for depth too, it’s just not a coding thing, it’s just how we choose to describe them

The depth is not an index

That makes sense, thank you!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.