Edit in JSRUN

console 命令行工具 X clear

                    
>
console
function foo(){
  console.log(a)
}

function bar(){
  var a = 3
  foo()
}

var a = 2

bar()