| Start |
|---|
| Initializing a 2D array Let's first recap how to initialize a 1D ruby array of integers: Being a 2D array simply an array of arrays, you can initialize it like this: |
| Initializing a 3D array You can go a level further down and add a third layer of arrays. The rules don't change: |
| Accessing a nested array Accessing the 3rd element of the first subarray: |
| Array flattening Given a multidimensional array: the operation of flattening is to decompose all array children into the root array: |
Read Article
https://develop.horje.com/learn/1434/reference