I am looking for some very basic examples of memory leaks in JavaScript and how to fix them. Specifically, if I do something like this in my code;
var obj = new MyObj();
Do I have to take care of something or do some steps explicitly so that obj does not leak? Or do I not have to worry about anything? Will it get garbage collected automatically by the browser ?
Are there any cross-browser differences in how memory handling is done (w.r.t. DOM or any other objects) ?