Test if a variable is defined in javascript?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/519145/how-can-i-check-whether-a-variable-is-defined-in-javascript">How can I check whether a variable is defined in JavaScript?</a>  </p>
</blockquote>



<p>How should I test if a variable is defined? </p>

<pre><code>if //variable is defined
    //do this
else
    //do this
</code></pre>
