Loading…

「谈谈」:闭包与Lambda

论起闭包,我想互联网上关于这个知识的具体分析着实是铢积锱累有着相当数量的文章。无他,[ 闭包 ]这个概念对于JavaScript这门语言来说实在是太过于重要,以至于重复说一百遍都不为过,第一篇「谈谈」,我也不免俗的来谈谈闭包。 关于闭包 首先官方ECMA-262给出的定义如下 A closure is a combination of a code block and data of a context in which this code block is created. 然后是MDN Mozilla Closures are functions that refer to independent (free) variables. In other words, the function defined in…