Possible Duplicate:
Location of parenthesis for auto-executing anonymous JavaScript functions?
Question is a duplicate of http://stackoverflow.com/questions/3384504/location-of-parenthesis-for-auto-executing-anonymous-javascript-functions and http://stackoverflow.com/questions/440739/what-do-parentheses-surrounding-a-javascript-object-function-class-declaration-me
Just curious really, what are the purposes of the brackets in this code:
(function() {})();
This looks like I could just as easily write:
var x=function(){};
(x)();
With jQuery plugins we would do something like...
(function($) {})(jQuery);
What's the deal with the brackets?