var的作用域比let更广 var允许重复声明 let则抛出异常 const已声明赋值不允许改变值
function v() {
var a = 10
{
var a= 20
console.log(a) //a=20
}
console.log(a)//a=20
}
v()
function l() {
let b = 10
{
let b = 20
console.log(b) //b=20
}
console.log(b) //b=10
}
l()