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.



Other FAQ Resources: