var/let/const 区别?暂时性死区?块级作用域?const a = {}; a.x = 1 能不能修改?
console.log(a); // undefined ===> a已声明还没赋值,默认得到undefined值 var a = 100;console.log(b); // 报错:b is not defined ===> 找不到b这个变量let b = 10;console.log(c); // 报错:c is not defined ===> 找不到c这个变量const c = 10;...
原创
2021-06-08 10:48:13 ·
2074 阅读 ·
0 评论