Each of the above is a perfectly valid way to create and access a hash. Quotes around the name allows you to use reserved words as the name, such as "function".
One thing to note here, is that the name must be either a string or a number, if its a number, you are better off using an array (if all your other keys are numbers too). This means that the name cannot be an object.
Now lets create a hash with more than one dimension. The function below is used to both init and add to a 3D hash.
We make sure not to access any elements that are undefined / not an object.
Now all we have left is a function to get values from our hash. This is not as straight forward as it may seem
The first statement is wrong, because if any of the 3 values passed in does not exist in the hash, you will try to access a property of undefined, causing an error. The second statement makes sure that each dimension exists before trying to access it, and finally returns either the value you want, or undefined.