You have:
self-running anonymous function
First, you create a function expression by positioning a paret around the function itself. Just write
function() {
}()
will not work on this instance because it will determine the function declaration.
So, after that we can call ourselves by adding()
(function() {
})();
To verify this, try the following:
var myval = (function(){return 'self executed!'})();
alert(myval);
source
share