title: Why do these snippets of JavaScript behave differently even though they both encounter an error?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var a = {}
  var b = {}
  
  try{
    a.x.y = b.e = 1 // Uncaught TypeError: Cannot set property 'y' of undefined
  } catch(err) {
    console.error(err);
  }
  console.log(b.e) // 1</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var a = {}
  var b = {}
  
  try {
    a.x.y.z = b.e = 1 // Uncaught TypeError: Cannot read property 'y' of undefined
  } catch(err) {
    console.error(err);
  }
  
  console.log(b.e) // undefined</code></pre>
  </div>
  </div>
  </p>