var i = 100;
function addI(){
var i = 0;
return function(){
iPP;
console.log(i);
}
}
addI()(); // 1
addI()(); // 1
var c = addI();
c(); // 1
c(); // 2
encountered this interview question today, ask for the popularization of science.
Why is the addI () () all 1 (understandably), while the c () () execution I is incremented?