title: Javascript global variable life time
body: <p>(I am Javascript Beginner)</p>
  
  <p>While I am learning Javascript global variable's life time, it say:</p>
  
  <blockquote>
    <p>The lifetime of Global variables starts when they are declared, and
    ends when the page is closed.</p>
  </blockquote>
  
  <p>I read that Javascript will store the global variable into window object? And when will it be destroyed? After I close the tab in web browser?</p>
  
  <p>For example: 
  If abc.com/page1.html create a global variable, after that in the same tab, I navigate to abc.com/page2.html will the global variable still there? How about if I navigate to another domain in the same tab, for example, another.com/page1.html?</p>