Thursday, 22 August 2013

what does (function () { ... })(); mean? [duplicate]

what does (function () { ... })(); mean? [duplicate]

This question already has an answer here:
What does this "(function(){});", a function inside brackets, mean in
javascript? [duplicate] 6 answers
I see that in many modules for node.js and also for browser, they use to
have all their code inside something like this:
(function () {
moduleName.prototype.variable = 'whatever';
})();
Can anyone please explain what this all is, or any links that explain? I
have no idea how to search it! Thanks in advance.

No comments:

Post a Comment