Tuesday, March 16, 2010

Javascript closures

A good article on javascript closures..

http://www.jibbering.com/faq/faq_notes/closures.html

From the article..

"A closure is formed when one of those inner functions is made accessible outside of the function in which it was contained, so that it may be executed after the outer function has returned. At which point it still has access to the local variables, parameters and inner function declarations of its outer function. Those local variables, parameter and function declarations (initially) have the values that they had when the outer function returned and may be interacted with by the inner function."