(…()) vs. (…)() in javascript closures [duplicate]
问题 This question already has answers here : Location of parenthesis for auto-executing anonymous JavaScript functions? (4 answers) Closed 4 years ago . 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