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

Merge pull request #1064 from ThroughTheNight/patch-1

Update let.md
This commit is contained in:
Ruan YiFeng 2021-07-23 00:12:35 +08:00 committed by GitHub
commit 12ce67fced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ for (let i = 0; i < 3; i++) {
// abc
```
上面代码正确运行,输出了 3 次`abc`。这表明函数内部的变量`i`与循环变量`i`不在同一个作用域,有各自单独的作用域。
上面代码正确运行,输出了 3 次`abc`。这表明函数内部的变量`i`与循环变量`i`不在同一个作用域,有各自单独的作用域(同一个作用域不可使用 `let` 重复声明同一个变量)
### 不存在变量提升