Possible Duplicate:
Location of parenthesis for auto-executing anonymous JavaScript functions?
Question is a duplicate of Location of parenthesis for auto-executing anonymous JavaScript functions? and What do parentheses surrounding a object/function/class declaration mean?
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?