title: typeof !== "undefined" vs. != null
body: <p>I often see JavaScript code which checks for undefined parameters etc. this way:</p>
  
  <pre><code>if (typeof input !== "undefined") {
      // do stuff
  }
  </code></pre>
  
  <p>This seems kind of wasteful, since it involves both a type lookup and a string comparison, not to mention its verbosity. It's needed because <code>undefined</code> could be renamed, though. </p>
  
  <p>My question is:<br>
  How is that code any better than this approach:</p>
  
  <pre><code>if (null != input) {
      // do stuff
  }
  </code></pre>
  
  <p>As far as I know, you can't redefine <code>null</code>, so it's not going to break unexpectedly. And, because of the type-coercion of the <code>!=</code> operator, this checks for both <code>undefined</code> and <code>null</code>... which is often exactly what you want (e.g. for optional function parameters). </p>
  
  <p>Yet this form does not seem widespread, and it even causes JSLint to yell at you for using the evil <code>!=</code> operator. </p>
  
  <p>Why is this considered bad style?</p>