const f=(function(){
let count=0;
return function(){
return “i have been called ${++count} times.";
}})();
f(); // i have been called 1 times.
f(); //i have been called 2 times.
我的理解每次f()的时候,都会先让count清0啊,哪里理解错了,求指教。
橋本奈奈未
cnyballk
相关分类