Javascript multidimensioned isset()
<p>When running:</p>

<pre><code>if (data.custaccount.webaddress) {
   alert('found it');
}
</code></pre>

<p>I get the error </p>

<pre><code>data.custaccount is undefined
</code></pre>

<p>The only way i can get around it seems to be with multiple IFs like so:</p>

<pre><code>if (undefined != data &amp;&amp; undefined != data.custaccount &amp;&amp; undefined != data.custaccount.webaddress) {
   alert('found it');
}
</code></pre>

<p>Is there any way i could do this more simply? </p>

<p>In php we'd normally use the isset(data.custaccount.webaddress) and that worked quite well. is there an equivalent in javascript (or jquery)?</p>

<p>We have used try / catch, but found that to slow down performance of the script considerably.</p>

<p>I've seen someone else asking something similar on <a href="http://verens.com/2005/07/25/isset-for-javascript/" rel="nofollow">http://verens.com/2005/07/25/isset-for-javascript/</a> without any success, but am hoping that stackoverflow will do it's normal job of saving the day :)</p>

<p>Thanks!!!</p>

<p>Justin</p>
