谈谈你对闭包的理解

MDN Javascript 文档对于闭包的定义如下:

Closures are functions that refer to independent (free) variables (variables that are used locally, but defined in an enclosing scope). In other words, these functions 'remember' the environment in which they were created.

闭包:是一种能够在函数内部读取或改写外部局部变量的函数,并且该变量可以常驻内存

自由变量

results for ""

    No results matching ""