title: Handling error message of 'undefined' in javascript
body: <p>As I can see in almost case, javascript would throw message <code>undefined</code> or <code>x is not defined</code>, etc...</p>
  <p>Here is some:</p>
  <pre><code>var i;
  var j = i;
  alert(j); // undefined
  
  var xyz;
  alert(xyz); // undefined
  </code></pre>
  <p><code>undefined</code>? No, it's defined without a default value. So, the error message should be:</p>
  <blockquote>
  <p>Use of unassigned local variable 'i'</p>
  <p>Use of unassigned local variable 'xyz'</p>
  </blockquote>
  <p>The error message of</p>
  <pre><code>alert(xyz); // Uncaught ReferenceError: xyz is not defined
  
  // or
  
  alert(xyz === undefined); // Uncaught ReferenceError: xyz is not defined
  </code></pre>
  <p>should become</p>
  <blockquote>
  <p>The name 'xyz' does not exist in the current context</p>
  </blockquote>
  <p>And the last:</p>
  <pre><code>alert(typeof(xyz) === 'undefined'); // true
  </code></pre>
  <p>So, the problem is: you want to get the type of <code>nothing</code>??? If something is-a <code>thing</code> (not <code>nothing</code>), the type should be an attribute of that. You can assign it after declaring, and only.</p>
  <p>My question: how is my idea to handle that error messages?</p>
  <p>p/s: I come from C# :)</p>