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控制台中查看时,它有一个闭包,其中有一个函数first,它还有自己的闭包,即它在闭包中具有重复循环的自身函数。有人知道这里发生了什么吗?我非常困惑,为什么会出现无限闭包循环。