How to handle 'undefined' in javascript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/27509/detecting-an-undefined-object-property-in-javascript">Detecting an undefined object property in JavaScript</a>  </p>
</blockquote>



<p>From the below javascript  sample</p>

<pre><code> try {
    if(jsVar) {
     proceed();
      }
 }catch(e){
      alert(e);
 }
</code></pre>

<p>this jsVar is declared and initialed in another js fine.</p>

<p>The problem is that code throws undefined error when this code is executed before the other file (where its declared and initiated) is executed. That is why it is surrounded by try and catch.</p>

<p>Whats the best way to handle this undefined error than try catch?</p>
