当前位置:网站首页>var、let、const之间的区别
var、let、const之间的区别
2022-07-25 15:29:00 【Gorgio_Liu】
var声明变量可以重复声明,而let不可以重复声明
var是不受限于块级的,而let是受限于块级
var会与window相映射(会挂一个属性),而let不与window相映射
var可以在声明的上面访问变量,而let有暂存死区,在声明的上面访问变量会报错
const声明之后必须赋值,否则会报错
const定义不可变的量,改变了就会报错
const和let一样不会与window相映射、支持块级作用域、在声明的上面访问变量会报错。
边栏推荐
- JVM知识脑图分享
- In depth: micro and macro tasks
- Pytorch学习笔记--SEResNet50搭建
- ML - 语音 - 语音处理介绍
- Notes on inputview and inputaccessoryview of uitextfield
- Cf566a greed + dictionary tree
- ML - 自然语言处理 - 自然语言处理简介
- PAT甲级1152 Google Recruitment (20 分)
- 你准备好脱离“内卷化怪圈”了吗?
- Pat grade a 1153 decode registration card of PAT (25 points)
猜你喜欢

Distributed principle - what is a distributed system

ML - natural language processing - Introduction to natural language processing

解决vender-base.66c6fc1c0b393478adf7.js:6 TypeError: Cannot read property ‘validate‘ of undefined问题

Brain racking CPU context switching

No tracked branch configured for branch xxx or the branch doesn‘t exist. To make your branch trac

Delayed loading source code analysis:

伤透脑筋的CPU 上下文切换

ML - 自然语言处理 - 关键技术

Pytorch学习笔记-刘二老师RNN高级篇-代码注释及结果

Pat grade a 1152 Google recruitment (20 points)
随机推荐
《图书馆管理系统——“借书还书”模块》项目研发阶段性总结
分布式原理 - 什么是分布式系统
C # carefully sorting out key points of knowledge 11 entrustment and events (recommended Collection)
MySQL optimization summary II
死锁杂谈
ZOJ - 4114 Flipping Game-dp,合理状态表示
Understanding the difference between wait() and sleep()
Idea eye care settings
带你详细认识JS基础语法(建议收藏)
2019 Shaanxi Provincial race K-variant Dijstra
C#精挑整理知识要点9 集合2(建议收藏)
Cf566a greed + dictionary tree
JVM garbage collector details
Graph theory and concept
Notes on inputview and inputaccessoryview of uitextfield
ZOJ - 4114 flipping game DP, reasonable state representation
UIDocumentInteractionController UIDocumentPickerViewController
JVM-参数配置详解
PAT甲级1153 Decode Registration Card of PAT (25 分)
JVM knowledge brain map sharing