当前位置:网站首页>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声明常量的时候就赋值(常用于定义配置文件)
边栏推荐
猜你喜欢
![[highcharts application - double pie chart]](/img/e9/e580d0e7dfcd00be137140abfe8569.png)
[highcharts application - double pie chart]
Flask 教程 第九章:分页

阿里云祝顺民:算力网络架构的新探索

手机投影到deepin

The new database is online | CnOpenData information transmission, software and information technology service industry basic information data of industrial and commercial registered enterprises
Introduction to GeoServer: 01-Introduction

二分查找的坑
GeoServer入门学习:06-发布多层级TIF地图大图数据
GeoServer introductory learning: 05-Multi-level MBTiles specification data release

编译原理——LR(1)分析程序(C#)
随机推荐
新规划|广州都市圈将以广佛为核心,广佛将有18条地铁相连通
3 MapReduce简单原理
day9 FastDFS
一下科技:未来短视频行业发展呈四大趋势
[The browser opens the exported excel]
Blazor PWA 单页应用身份认证机制示例
语义分割FCN FPN UNet DeepLab HRNet SETR TransFuse...
SQL注入之搭建dnslog
Members that must be initialized for initial column initialization
Flask 教程 第十章:邮件支持
【highcharts应用-双饼图】
单片机——串口通信(从串口接收多位数据保存到数组,发送多位数据到串口)
手机投影到deepin
charles简单使用
Gradle is as simple as using kotlin to write common commands
Non-resolvableparent POM for xxxx: Could not find artifact xxx and ‘parent.relativePath‘ points at
去噪论文 Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising
【Export PDF-Project Application】
GeoServer入门学习:01-开篇
wp-ctfshow-web10 (group up注入)