mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-25 03:02:21 +00:00
const 关键字只能声明常量,这个在其他语言中也类似,在MDN上的定义中也是这样的
This commit is contained in:
parent
71b13a4351
commit
ffa0100aa2
@ -349,7 +349,7 @@ f() // ReferenceError: f is not defined
|
|||||||
|
|
||||||
## const命令
|
## const命令
|
||||||
|
|
||||||
const也用来声明变量,但是声明的是常量。一旦声明,常量的值就不能改变。
|
const 声明一个只读的常量。一旦声明,常量的值就不能改变。
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
'use strict';
|
'use strict';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user