title: undefined type behave different in JS
body: <p>I was just trying this JS code - </p>
  
  <pre><code>if(a){
      console.log("a IS DEFINED")
  } else {
      console.log("a IS UNDEFINED")
  }
  </code></pre>
  
  <p>and I am getting error - </p>
  
  <pre><code>ReferenceError: a is not defined
  </code></pre>
  
  <p>But when I add <code>var a</code> it prints <code>a IS UNDEFINED</code></p>
  
  <pre><code>var a;
  if(a){
      console.log("a IS DEFINED")
  } else {
      console.log("a IS UNDEFINED")
  }
  
  // prints a IS UNDEFINED
  </code></pre>
  
  <p>Why it behaves differently where in both case <code>a</code> is <code>undefined</code>?</p>