实例一 python js如何结束闭包。def line_conf(): def line(x): Python的数据类型、 return 2*x+1 print(line(5)) # within the scope javascript静态变量, line_conf() print(line(5)) # out of the scope 运行结果如下 Line函数是未定义的因为它是嵌套函数 我们再来看
透彻的解释: A closure is a special kind of object that combines two things: a function, and the environment in which that function was created 之前的解释:一个func将它的innerFunc作为返回值,那么这个innerFunc被称之为闭包 两者都对,