title: why referencing non-existent property of an object in javascript doesn't return a reference error?
body: <p>If I try to reference a non-existent variable, I get ReferenceError in JavaScript. Why referencing a non-existent object property returns 'undefined'?
  Here is some code, provided I'm writing it in a browser:</p>
  
  <pre><code>alert(a);
  ReferenceError: a is not defined //error is thrown
  alert({}.a)
  undefined //no error
  </code></pre>