Skip to content

var、let、const

  • var 是函数作用域,后者是块级作用域
  • var 变量提升,先使用后声明
  • var 可以重复声明
  • var let 可以重新赋值,const 声明常量,不能重新赋值,但能修改引用类型的值