暂时性死区

function go(n) {
  // n here is defined!
  console.log(n); // Object {a: [1,2,3]}

  for (let n of n.a) { // ReferenceError 这就算是暂时性死区 因为在这个作用域内改变了被声明以后 是不可以提前调用的。
    console.log(n);
  }
}

go({a: [1, 2, 3]});

 

posted @ 2018-09-28 11:01  悔创阿里-杰克马  阅读(292)  评论(0编辑  收藏  举报
求投食~(点图即可)