javascript self executing function code example
Example 1: self invoked function javascript
(function(){
//Bunch of code...
})();
Example 2: call a self executing function javascript
var foo = (function bar() {
alert('hello');
return bar;
})(); // hello
foo(); // hello
Example 3: javascript run self exectutin object
(function (parameters) {
// Function body
})(parameters);