I know this is silly, but there's any difference between this:
(function() {
var foo = 'bar';
})();
and this?
(function() {
var foo = 'bar';
}());
JSLint tells us to Move the invocation into the parens that contain the function
, but I see no need to.
Edit: The answers are too cool. ~function
, the JSHint alternative along with jQuery's preference for (/***/)();
and Crockford's explanation! I thought I was going to just get a "they're the same thing" kind of answer.
You guys decide the best one through upvotes and I tick it.