What is function closure?
- Functions that are defined within a function can access variables in the function they are defined, even after this function has completed its task. This possibility is to be considered as a closure in the computer science literature.
To put it another way; a closure is created when a function
keeps a link to its parent's scope even after the parent has returned.
- In web site development, one wishes at times animation. Closure is in practice often used to get such effects.
The following is an example of how to change the background color of a web-page using
the closure and setInterval() method, found in the Windows environment
© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the
correctness in the pages or source codes.
The risk of using this web-site pages or any program
codes from this website is entirely at the individual user.