Tuesday, February 7, 2012

What is (function(){})() in Javascript?

Call self-executing anonymous function, related to function closure.

Reference:
An Important Pair of Parens
http://peter.michaux.ca/articles/an-important-pair-of-parens

http://stackoverflow.com/questions/440739/what-do-parentheses-surrounding-a-javascript-object-function-class-declaration-m

Function Closure:
http://en.wikipedia.org/wiki/Closure_%28computer_science%29

No comments:

Post a Comment