当前位置:网站首页>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声明常量的时候就赋值(常用于定义配置文件)
边栏推荐
- Process实现守护线程
- MySQL
- WebView的使用
- 并发和并行——从线程,线程池到任务
- 编译原理——词法分析程序(C#)
- Jmeter常见问题处理及常用功能
- GeoServer introductory study: 07 - release a larger multi-tiered TIF map data
- Introduction to GeoServer: 01-Introduction
- C#实现Everything——UI与查询 附源码
- Iterative version of preorder traversal, inorder traversal, and postorder traversal of binary tree
猜你喜欢
Getting Started with GeoServer: 04-Publishing Shapfile Map Data
GeoServer Getting Started Learning: 06-Publishing Multi-level TIF Map Data
目标检测论文 Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector
【转发与重定向(二)】
day9 FastDFS
手机投影到deepin
去噪论文 Attention-Guided CNN for Image Denoising
day4——乐优商城项目结构(6个微服务)
目标检测论文 Precise detection of Chinese characters in historical documents with DRL
昇腾Ascend 随记 —— TensorFlow 模型迁移
随机推荐
[Oracle's NVL function usage]
【idea_取消自动import .*】
C语言打印九九乘法表
单片机——串口通信(从串口接收多位数据保存到数组,发送多位数据到串口)
ssh 登录connectction reset by peer
AtCoder Beginner Contest 263(A~F)
目标检测论文 Bridng the Gap Between Anchor-based and Anchor-free Detection via ATSS
Bagging、Boosting、Stacking集成学习代码
昇腾Ascend 随记 —— 昇腾 AI 的基本架构
go实现快速排序
【梦想的声音】
[MEF] Chapter 04 MEF's Multi-Component Import (ImportMany) and Directory Services
keras调用load_model时报错ValueError: Unknown layer:*解决办法
[MEF]第05篇 MEF的目录(Catalog)筛选
day11 基于Rest的操作、查询聚合索引
Redis Bloom Filter
C语言斐波那锲数列前n项求和
The first day of a solid foundation for Kotlin
Kotlin's JSON format parsing
Flask 教程 第十二章:日期和时间