window.onload = function(){
function f1(){
var a = 0;
function f2(){alert(++a)};
return f2;
}
var f3 = f1();
f3();
f3();
};
输出结果是 1,2
window.onload = function(){
function f1(){
var a = 0;
function f2(){alert(++a)};
return f2;
}
var f3 = f1();
f3();
f3();
};
输出结果是 1,2