What are Javascript closures?When would you use them?
Two one sentence summaries: a closure is the local variables for a function – kept alive after the function has returned or a closure is a stack-frame which is not deallocated when the function returns. A closure takes place when a function creates an environment that binds local variables to it in such a way … Read more