Javascript object of unknown arbitrary depth causes script to stop execution
<p>I might receive a JSON structure like this</p>

<pre><code>foo: {}
</code></pre>

<p>Or I might like this:</p>

<pre><code>foo: {bar: {baz: 1} }
</code></pre>

<p>When I check the first data structure for existence like this:</p>

<pre><code>if ( data.foo.bar.baz ) { }
</code></pre>

<p>The script stops running altogether.  I can't see any javascript errors on the browser or anything.  It just stops.  Either way tho, it would be nice to be able to do the above instead of:</p>

<pre><code>if ( data.foo &amp;&amp; data.foo.bar &amp;&amp; data.foo.bar.baz ) { }
</code></pre>

<p>What's the best way to address this issue?</p>
