closure.js
/*--------------------s3sivaram-----------------------------------------------  
   Values of variables declared within a function gets lost as soon as the function 
   execution gets over.
   
   Closure is a way of the storing the values of the variables declared within a function 
   to refer it even after its execution is over.
   
   By defining an inner function within a function , the values passed to the outer function
   always remains for the inner function to refer to.
    
--------------------------------------------------------------------------------*/
s3sivaram
Values of variables declared within a function gets lost as soon as the function
execution gets over.

Closure is a way of the storing the values of the variables declared within a function
to refer it even after its execution is over.

By defining an inner function within a function , the values passed to the outer function
always remains for the inner function to refer to.
s3sivaram Values of variables declared within a function gets lost as soon as the function execution gets over . Closure is a way of the storing the values of the variables declared within a function to refer it even after its execution is over . By defining an inner function within a function the values passed to the outer function always remains for the inner function to refer to .
function outerFunc(outvar){
    function innerfunc(innervar){
        var innervar = innervar+outvar;
        return innervar; 
    }
return innerfunc;
}
function outerFunc ( outvar ) { function innerfunc ( innervar ) { var innervar = innervar + outvar ; return innervar ; } return innerfunc ; }
s3sivaram
Values of variables declared within a function gets lost as soon as the function
execution gets over.
s3sivaram Values of variables declared within a function gets lost as soon as the function execution gets over .
// returns only the address of the innerfunc & not the result