1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

Merge pull request #84 from icecreamliker/patch-3

update let.md
This commit is contained in:
Ruan YiFeng 2015-09-21 11:26:24 +08:00
commit c32f131c79

View File

@ -208,7 +208,7 @@ function f(){
f() // undefined
```
上面代码中函数f执行后没有任何输出原因在于变量提升导致内层的tmp变量覆盖了外层的tmp变量。
上面代码中函数f执行后,输出结果为`undefined`原因在于变量提升导致内层的tmp变量覆盖了外层的tmp变量。
第二种场景,用来计数的循环变量泄露为全局变量。