In Javascript, a closure is essentially a function along with the lexical environment within which it was declared. Lexical environment simply refers to the scope or context in which a function is declared, including all the variables that were in scope at that point.
↧