title: How do I check for undefined types in JavaScript?
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/5515310/is-there-a-standard-function-to-check-for-null-undefined-or-blank-variables-in">Is there a standard function to check for null, undefined, or blank variables in JavaScript?</a></p>
  </blockquote>
  
  <p>What is the best way to check for the <code>undefined</code> type in JavaScript? I know one way to check is by using <code>typeOf</code>, but I have to check for it in lots of places; is there a shorter or better way to do this?</p>
  <p>I tried a few ways but didn't succeed:</p>
  <pre><code>alert(undefined === &quot;undefined&quot;);
  alert(undefined || &quot;defined&quot;); 
  </code></pre>