Undefined values when trying to create a multi-dimensional array
<p>I'm trying to create a multi-dimensional array. </p>

<p>My assumption that the following structure <code>stuff['mykey1']['mykey2']['mykey3']</code> can be interpreted as <code>stuff</code> is an array of two-dimensional arrays. And <code>stuff['mykey1']</code> will return me a two dimensional array with following keys <code>['mykey2']['mykey3']</code></p>

<p>I try to create this structure like so:</p>

<pre><code>var stuff = null;

if(stuff === null) 
{
    stuff = []; // stuff is []
}

if(stuff[userId] === undefined)
{
    stuff[userId] = [];  // stuff is [undefined, undefined, undefined, 888087 more...]
}

if(stuff[userId][objectId] === undefined)
{
    stuff[userId][objectId] = [];
} 
</code></pre>

<p>However, when I look at stuff array as I step through, I see that after <code>stuff[userId] = []</code>; stuff array is <code>[undefined, undefined, undefined, 888087 more...]</code></p>

<p>I'm expecting [888087, []]</p>

<p>Where do the undefined values come from? </p>
