Do I have to initialize every level of an object in Javascript?
<p>I'm not terribly good with Javascript so I'm wondering if there is a better way of doing this:</p>

<pre><code>if (games[level] === undefined) {
    games[level] = {};
    games[level]['pending'] = {};
}

if (!games[level]['pending'].length) {
    return game.create(level);
}
</code></pre>

<p>In PHP I can just test empty($games[$level]['pending']). Is there a better way of testing for this? Basically all I want to do is create the object if it does not exist.</p>
