Prev: Javascript PDF reference manual?
Next: FAQ Topic - Internationalisation and Multinationalisation in javascript. (2010-03-23)
From: FAQ server on 26 Mar 2010 20:00 ----------------------------------------------------------------------- FAQ Topic - What is (function(){ /*...*/ })() ? ----------------------------------------------------------------------- This is an anonymous FunctionExpression which is called right 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. http://yura.thinkweb2.com/named-function-expressions/ http://www.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. |