How do I create a dynamic set of arrays in javascript, to form a hierarchy of arrays? I would like this to work dynamically. How to create a root array, that will always be there, and each new array dynamically created, will be nested in the previous array to form a hierarchy.
feedback
|
...do you know what's going in these arrays, or have any idea how big or deep they go? And are you talking about only indexed arrays, or objects with named properties, as well? If all you want is arrays:
So now you've got arrays nested like:
As you can probably see, you can happily go on building deeper and deeper arrays.
If you wanted to do this dynamically, you could create them in a Keep in mind, though, accessing data inside of these will suck. To get at the deepest array, you'd have to go:
| |||
feedback
|