title: check JavaScript variable null or not?
body: <p>Iam using following lines of code to check whether the JS variable 'userName' is null or not.
  But am always getting <code>alert "not empty"</code></p>
  
  <p>Please check my <code>onready</code> method:</p>
  
  <pre><code>$("document").ready(function (){
      var userName = "";
      if (userName == undefined || userName == null) {
          alert('empty');
      } else {
          alert('not empty');
          var div = document.getElementById('title b');
          div.innerHTML = div.innerHTML + ','; 
      }
  });
  </code></pre>