{
d=200;//Cannot access 'd' before initialization let声明的变量不可以在声明之前进行使用
let d;
}
console.log(d);
隐藏的暂时性死区
//es6中初始化参数的写法
function func(x=10,y=20){
console.log(x,y)
}
func(30,50);//30,50 x=30,y=50
function func(x=y,y=20){//let x=y, let y=20
console.log(x,y)
}
func();//Cannot access 'y' before initialization 'y'在未声明前不可使用
不能重复声明 在同一个作用域内,不能重复声明同一个变量
let x=100;
let x=200;//Identifier 'x' has already been declared 标识符“x”已声明