[removed] why a variable undefined in inner function, even though the variable declared and assigned in the global

后端 未结 0 1398
深忆病人
深忆病人 2020-12-30 03:53
let a = 1;
function outer() {
  console.log(a);

  function inner() {
    console.log(a);
    var a = 3;
  }
  inner();

  console.log(a);
}

outer();
相关标签:
回答
  • 消灭零回复
提交回复
热议问题