SOURCE

function foo(){
  var local = 1
  function bar(){
    local++
    return local
  }
  return bar
}

var func = foo()
console.log(func())
console 命令行工具 X clear

                    
>
console