I\'m trying to wrap my head around closures (there\'s a joke in there somewhere) and I ran across this:
(function () { /* do cool stuff */ })();
That construct means declare an anonymous function and run it immediately. The reason you put your code inside a function body is because the variables you define inside it remain local to the function and not as global variables. However, they will still be visible to the closures defined inside this function.