Skip navigation

Tag Archives: anonymous

/*Anonymous function with parameter, executed immediately*/
(function(foo, bar){

Interestingly anonymous functions used to create closures. Closure is protected variable space.

Consider the following function
var foo=2;
var bar=3;
mul = function(){

You won’t get any alerts after its execution. but

will give an alert !

After anonymous function’s execution, how can function mul get executed? that too accessing its foo and bar?

Will update the post soon!!!