Most people don’t realize this, but JavaScript can leak memory if you don’t write it properly. This is a strange concept, because for one, it runs in the browser, two, it’s a scripting language so it feels simpler, and 3 because you usually don’t do very much in JavaScript.
But, when JavaScript is written carelessly, it can lead to enourmous memory leaks that can actually crash the browser.
Take a look at this
incredible article on javascript memory leakage up at CodeProject posted by Volkan Ocelik to find out the different leakage patterns and how to avoid them.
In order to fully understand how to avoid memory leakage, it is important that you understant closures. The best explanation I have found is
here.
So make sure you think when writing JavaScript so you don't hurt yourself.