In this section I will be going over just some simple examples of making 2d arrays of arrays this way.
So for this example I just have a grid of single digit hex values that is four by four. I start out with just a simple array, and then have four arrays within that array. In each nested array I then have my hex values where the lowest hex value is the first index of the first nested array, things then progress from that index value forward to the end of the nested array, and then continue in the next.
I can then access the primitive value in each nested array, by using the bracket syntax just like a single array, only when doing so I get a nested array rather than a primitive value, so Then need to give the index value of the element that I want in the nested array to get an element with one of my hex values.
If you are still confused maybe it would be best to look at a code example of this.
This is a static form of a 2d array of arrays, however often I will want to have a way to generate such an array, so for this I will want to use some loops, and maybe do so in the body of a function.
Although arrays of arrays work okay, I often just use a single array, and then work out a formula that is used to figure the proper index value for this single array.
Now to do the same thing, only once again make a function that will return my multidimensional array. Only this time it will return the array along with at least a width property. In addition I might also want a height property, and a method that I can use to get a location by way of passing an x and y value.
So then there is working something out for working with three or more dimensions. I quickly put something together for that, but it is still not working the way I would like it to really.