About closure Quoting Wikipedia: In computer science, a closure, also known as a lexical closure or function closure, is a technique for implementing lexical binding in programming languages that support first-class functions. In implementation, a closure is a structure that stores a function (usually its entry address) and an associated environment (equivalent to a symbol lookup table). The above description is very professional. I prefer to describe it this way: the ability of a function to remember and access variables in the scope in which it was defined . This characteristic is often used extensively in functional programming languages. This type of code is typically written in JavaScript: Why can the count variable still be accessed outside the outer function? Because the outer function returns an inner function, and the inner function holds a reference to count, the local variable count will not be destroyed after outer finishes executing.…