You need to sign in to do that
Don't have an account?
Sandhya K 10
JavaScript Closure
What is Javascript Closure ? How can we use that in a VF page ? An example of the same would be very helpful .
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
A closure is an inner function that has access to the outer (enclosing) function’s variables—scope chain. The closure has three scope chains: it has access to its own scope (variables defined between its curly brackets), it has access to the outer function’s variables, and it has access to the global variables.
The inner function has access not only to the outer function’s variables but also to the outer function’s parameters. Note that the inner function cannot call the outer function’s arguments object, however, even though it can call the outer function’s parameters directly.
Please check with below links which provide additional information.
- http://javascriptissexy.com/understand-javascript-closures-with-ease/
- https://www.w3schools.com/js/js_function_closures.asp
Hope this helps.Thanks,
Nagendra.