SOURCE

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

var result = f1();

result();
result();
console 命令行工具 X clear

                    
>
console