当前位置:网站首页>ES6新特性let和const
ES6新特性let和const
2022-08-08 21:04:00 【驻风丶】
let的特点:
1、let和const不存在变量提升(不可以声明提前),原因let和const之前的区域叫做暂存性死区,var的变量存在变量提升
2、使用let和const声明的变量不再属于window,不能通过window.变量名访问,var声明的变量属于window
3、使用块级作用域不能在同一级中重复声明变量(let变量不能重复声明)
const 声明的是常量 (只读不可修改)
const和let除了const声明的是常量,其他和let一样
注意:必须在const声明常量的时候就赋值(常用于定义配置文件)
边栏推荐
猜你喜欢
第十三届蓝桥杯(Web 应用开发)线上模拟赛【第九题】(知乎首页数据动态化)
The new database is online | CnOpenData information transmission, software and information technology service industry basic information data of industrial and commercial registered enterprises
Flask 教程 第十三章:国际化和本地化
GeoServer入门学习:07-发布多层级TIF地图大图数据
pytorch实现数据集读取/下载
编译原理——LR(1)分析程序(C#)
澳洲ABM创新模式将销售代理权给到个体,让利消费者
手机投影到deepin
EasyExcel上传文件并使用Postman测试
SQL-堆叠注入(含例题)
随机推荐
Kotlin parsing String path knowledge
- project experience 】 【 conservation projects
The access to the local projects, localhosthost can, local IP can't 】
安全策略及电商购物订单简单用例
第06篇 MEF部件的生命周期(PartCreationPolicy)
【Life Growth】——Xiaobai's Growth Adventures
新规划|广州都市圈将以广佛为核心,广佛将有18条地铁相连通
mysql8设置远程连接
wp-ctfshow-web10 (group up注入)
AtCoder Beginner Contest 263(A~F)
GeoServer入门学习:04-发布Shapfile地图数据
磁控胶囊胃镜:具有良好耐受性的非侵入性胃镜检查
如何改变数组对象里面的key 键名字
H5页面调用手机打电话功能
【Export PDF-Project Application】
编译原理——LR(1)分析程序(C#)
Iterative version of preorder traversal, inorder traversal, and postorder traversal of binary tree
Blazor PWA 单页应用身份认证机制示例
Solve the problem of slow speed of gradle import package
day7——CORS跨域问题