On 30 Dez., 08:45, "Alexandre Plennevaux" <aplennev...@gmail.com> wrote: > "JavaScript enclosures"? > > i think it has to do with encapsulating your code inside a function so > that all vars are inside the function's scope, so not cluttering the > global namespace. > This, to avoid memory leak.
Are you implying that global variables do leak memory? There are good reasons to not clutter the global namespace but I don't believe avoiding leaks is one of them. Actually you do increase the chance to create leaks in IE if you use closures under certain circumstances. --Klaus