In javascript, when would you want to use this:
(function(){ //Bunch of code... })();
over this:
//Bunch of code...
One difference is that the variables that you declare in the function are local, so they go away when you exit the function and they don't conflict with other variables in other or same code.