mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-25 11:12:21 +00:00
Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages
This commit is contained in:
commit
bde94c1e77
@ -240,7 +240,6 @@ ES6允许块级作用域的任意嵌套。
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{{{{{let insane = 'Hello World'}}}}};
|
{{{{{let insane = 'Hello World'}}}}};
|
||||||
insane // "Hello World"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
上面代码使用了一个五层的块级作用域。外层作用域无法读取内层作用域的变量。
|
上面代码使用了一个五层的块级作用域。外层作用域无法读取内层作用域的变量。
|
||||||
@ -328,9 +327,6 @@ PI // 3.1415
|
|||||||
|
|
||||||
PI = 3;
|
PI = 3;
|
||||||
PI // 3.1415
|
PI // 3.1415
|
||||||
|
|
||||||
const PI = 3.1;
|
|
||||||
PI // 3.1415
|
|
||||||
```
|
```
|
||||||
|
|
||||||
上面代码表明改变常量的值是不起作用的。需要注意的是,对常量重新赋值不会报错,只会默默地失败。
|
上面代码表明改变常量的值是不起作用的。需要注意的是,对常量重新赋值不会报错,只会默默地失败。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user