function buildList( list ) {
var i = 0;
var first = function () {
console.log( "in" )
console.log( i );
}
var Second = function () {
console.log( "out" )
first();
}
return Second;
}
var a = buildList( [1, 2, 3] )
console.dir( a );
a(); // Here closure is created which has function first ,Here first also has one closure of itself that means recursive closure
当我在 Chrome 中看到我的控制台时,它有一个首先具有函数的闭包,它本身也有一个闭包,即它在闭包中有自己的函数的重复循环,有谁知道这里发生了什么,我很困惑,为什么会有无限闭环