mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-27 20:32:21 +00:00
Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages
This commit is contained in:
commit
aae41fcb21
@ -205,10 +205,10 @@ function f(){
|
||||
}
|
||||
}
|
||||
|
||||
f() // 没有输出
|
||||
f() // undefined
|
||||
```
|
||||
|
||||
上面代码中,函数f执行后没有任何输出,原因在于变量提升,导致内层的tmp变量覆盖了外层的tmp变量。
|
||||
上面代码中,函数f执行后,输出结果为`undefined`,原因在于变量提升,导致内层的tmp变量覆盖了外层的tmp变量。
|
||||
|
||||
第二种场景,用来计数的循环变量泄露为全局变量。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user