Prev: FAQ Topic - What does the future hold for ECMAScript? (2010-07-20)
Next: GHD limited edition colour collection
From: FAQ server on 23 Jul 2010 19:00 ----------------------------------------------------------------------- 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/> 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. |