1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-27 20:32:21 +00:00

函数内部重新声明参数

函数内部重新声明参数在函数声明时不会报错,在使用时才会报错
This commit is contained in:
CosSalt 2019-02-13 12:56:05 +08:00 committed by GitHub
parent 29abe06a96
commit b72d92aab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,14 +201,16 @@ function func() {
```javascript
function func(arg) {
let arg; // 报错
let arg;
}
func() // 报错
function func(arg) {
{
let arg; // 不报错
let arg;
}
}
func() // 不报错
```
## 块级作用域