MCMastery MCMastery - 2 years ago 251
Javascript Question

Javascript - setInterval()

I am making a game using Javascript, and to update the game I am using setInterval(). Should I use clearInterval() somehow on the window exit, or does it automatically stop?

Answer Source

The browser is (or better: should be) clever enough to fully clean up a closed website. That includes aborting it's running connections and terminating scripts. Data that stays on your PC after you close the tab usually only includes stuff like browser history entries, cookies, local storage and cached data (e.g. scripts, stylesheets, images).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download