javascript-声明提升

时间:2021-05-24 01:47:56   收藏:0   阅读:0
let a = 1

function b() {
  /*
  //一
  作用域内声明提升
  console.log(a)//undefined
  let a = 2
  */
  //
  console.log(a)//1
  a = 2
}

b()

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!