var add;
var f1 =
function() {
var a =
1;
add =
function() {
a++
;
}
function f2() {
console.log(a);
}
return f2;
}
var t1 =
f1();
var t2 =
f1();
var t3 =
f1();
add();
t1(); // 1
t1(); // 1
t2(); // 2
t2(); // 2
// t3()
转载于:https://www.cnblogs.com/ax-null/p/6958799.html
转载请注明原文地址: https://win8.8miu.com/read-1557915.html