What does a block of code in parentheses mean in JavaScript/jQuery? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: What does (function($) {})(jQuery); mean? I've seen a lot of jQuery code with the following sort of syntax, but I don't really understand what it means. It shows up in this answer and this answer on a question about code organization. Both talk about namespacing, so I'm guessing that's what it accomplishes. var foo = (function () { var someVar; function someFunc() { return true; } })(); Is this for namespacing,