跳转至

let vs var

var 声明的变量往往会越域 let 声明的变量有严格局部作用域

var 可以声明多次 let 只能声明一次

var x console.log(x)会提示没有定义而不是没有变量 var 会变量提升 let 不存在变量提升

const

常量,只读