title: Bubbling scope - Updating var from nested function
body: <p>I'm updating a variable from an outer scope in a nested function,<br>
  as this is happening during a init function the outer scope isn't the outermost (window) scope;</p>
  
  <pre><code>var init = function() {
  
    var x = 'old stuff' ;      
  
          function butClick() {
            x = 'new stuff' ; 
          }
    console.log(x); //  new stuff
  
    document.querySelector("btn").addEventListener("click", butClick, false);
  }
  window.addEventListener( 'DOMContentLoaded', init, false);
  </code></pre>
  
  <p>in order to save it in the init-function scope I'm omitting the <strong>var</strong> keyword and as expected the new value of the variable bubbles up and updates;</p>
  
  <p>but the result of  <code>console.log('x' in window )</code>  is false,<br>
  isn't the bubbling supposed to get to the window scope?</p>