# 你对JS闭包的理解可能是完全错误的

calidion 发表于 • 2017年05月10日 19:35 • 共 • 1636 • 次浏览

2 回复
0

0
##### calidion 楼主 回复了 # 94 发放红包 2017年06月23日 16:48   # 2 楼
In programming languages, closures (also lexical closures or function closures) are techniques for implementing lexically scoped name binding in languages with first-class functions. Operationally, a closure is a record storing a function[a] together with an environment:[1] a mapping associating each free variable of the function (variables that are used locally, but defined in an enclosing scope) with the value or reference to which the name was bound when the closure was created.[b] A closure—unlike a plain function—allows the function to access those captured variables through the closure's copies of their values or references, even when the function is invoked outside their scope.