|
|||
|
-----------------------------------------------------------------------
FAQ Topic - What is (function(){ /*...*/ })() ? ----------------------------------------------------------------------- This is an anonymous FunctionExpression that is called immediately after creation. Variables declared inside a function are not accessible from outside the function. This can be useful, for example, to hide implementation details or to avoid polluting the global scope. <URL: http://yura.thinkweb2.com/named-function-expressions/> <URL: http://jibbering.com/faq/notes/closures/> <URL: http://dmitrysoshnikov.com/ecmascript/chapter-5-functions/#question-about-surrounding-parentheses> The complete comp.lang.javascript FAQ is at http://jibbering.com/faq/ -- The sendings of these daily posts are proficiently hosted by http://www.pair.com. |
|
|
||||
|
||||
|
|
|
|||
|
On 2012-07-02, FAQ server <javascript@dotinternet.be> wrote:
> ----------------------------------------------------------------------- > FAQ Topic - What is (function(){ /*...*/ })() ? > ----------------------------------------------------------------------- > > This is an anonymous FunctionExpression that is called > immediately after creation. I have seen that sort of thing on a spammer page or two. /*...*/ is ... not a regular expression ... it is just ... a comment. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|