ES6 中var和let区别

1,var

var是函数级别的作用域

2,let

let是块级的作用域(花括号)

let 不存在变量提升

 

posted @ 2024-02-15 20:16  学无边涯  阅读(4)  评论(0编辑  收藏  举报