📅  最后修改于: 2022-03-11 15:01:35.900000             🧑  作者: Mango
function outer() {
var counter = 0; // Backpack or Closure
function incrementCounter() {
return counter++;
}
return incrementCounter;
}
const count = outer();
count(); // 0
count(); // 1
count(); // 2