function f1(){ var n = 0; function f2(){ n++; console.log(n); } return f2; } var result = f1(); result(); result();