how to determine undefined on a object property with an unknown level
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2631001/javascript-test-for-existence-of-nested-object-key">javascript test for existence of nested object key</a>  </p>
</blockquote>



<p>Consider this:</p>

<pre><code>typeof(object.prop1.prop2) == "undefined"
</code></pre>

<p>where
<code>object.prop1</code> is undefined</p>

<p>This will output a javascript error, how to handle this situation beautifully?<br>
ie: no multiple if</p>
