1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-25 19:22:21 +00:00

Merge pull request #92 from nfer/gh-pages

修正示例代码错误
This commit is contained in:
Ruan YiFeng 2015-09-30 07:44:51 +08:00
commit 26b64fd6b7

View File

@ -244,7 +244,6 @@ ES6允许块级作用域的任意嵌套。
```javascript ```javascript
{{{{{let insane = 'Hello World'}}}}}; {{{{{let insane = 'Hello World'}}}}};
insane // "Hello World"
``` ```
上面代码使用了一个五层的块级作用域。外层作用域无法读取内层作用域的变量。 上面代码使用了一个五层的块级作用域。外层作用域无法读取内层作用域的变量。
@ -332,9 +331,6 @@ PI // 3.1415
PI = 3; PI = 3;
PI // 3.1415 PI // 3.1415
const PI = 3.1;
PI // 3.1415
``` ```
上面代码表明改变常量的值是不起作用的。需要注意的是,对常量重新赋值不会报错,只会默默地失败。 上面代码表明改变常量的值是不起作用的。需要注意的是,对常量重新赋值不会报错,只会默默地失败。