当前位置:网站首页>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相映射、支持块级作用域、在声明的上面访问变量会报错。
边栏推荐
- Cf685b find the center of gravity of each subtree of a rooted tree
- mouseover和mouseenter的区别
- How to solve the login problem after the 30 day experience period of visual stuido2019
- Binary complement
- MATLAB 如何生产随机复序列
- MySQL优化总结二
- 小波变换--dwt2 与wavedec2
- IOS interview questions
- CF365-E - Mishka and Divisors,数论+dp
- PAT甲级1153 Decode Registration Card of PAT (25 分)
猜你喜欢

matlab---错误使用 var 数据类型无效。第一个输入参数必须为单精度值或双精度值

MATLAB 如何生产随机复序列

CF888G-巧妙字典树+暴力分治(异或最小生成树)

Geogle Colab笔记1--运行Geogle云端硬盘上的.py文件

Games101 review: Transformation

Pat grade a 1152 Google recruitment (20 points)

JVM知识脑图分享

Cf888g clever dictionary tree + violent divide and conquer (XOR minimum spanning tree)

图论及概念

Delayed loading source code analysis:
随机推荐
MATLAB 如何生产随机复序列
See a lot of blinking pictures on apps, especially the member page
Deadlock gossip
Take you to learn more about JS basic grammar (recommended Collection)
Cf566a greed + dictionary tree
MATLAB读取显示图像时数据格式转换原因
2021 Shanghai match-h-two point answer
数据系统分区设计 - 分区与二级索引
ML - 自然语言处理 - 自然语言处理简介
《图书馆管理系统——“借书还书”模块》项目研发阶段性总结
The development summary of the function of fast playback of audio and video in any format on the web page.
理解“平均负载”
MySQL—用户和权限管控
死锁杂谈
分布式原理 - 什么是分布式系统
如何解决跨域问题
MySQL transactions and mvcc
Graph theory and concept
PAT甲级题目目录
Cf685b find the center of gravity of each subtree of a rooted tree