How to use closure concept in jquery?
|
Rate this page :
|
[ 0 votes]
|
The closure can access the variable count in parent scope. The function closure() will return value of a self invoking function. It sets the count to zero (0),and returns a function expression. The same way that notclosure() function returns the count value but it does not have the scope of the variable. This shows a simple Jquery closure code, where the scope of variable is explained.