title: Are JavaScript timers immediately cleaned up when you close a browser tab?
body: <p>Say I have created a timer via:</p>
  
  <p><code>setTimeout()</code></p>
  
  <p>(or I'm using <code>setInterval()</code>)</p>
  
  <p>Whilst that timer is ticking down, and before it expires, I decide to close the browser tab which that code is executing in. Does the browser automatically clean up the timer at that point (taking into account that I have not called clearTimeout() at all)?</p>
  
  <p>I would like to know whether there is a possibility of code lingering in memory for long enough that, when the timeout value has been reached, it could still execute code. Or whether closing the tab means the timer is wiped from memory, and thus the function to call in the <code>setTimeout()</code> will never be executed.</p>