mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
edit let
This commit is contained in:
parent
9d2ef28e22
commit
97b5d89f3b
@ -158,7 +158,7 @@ bar();
|
||||
上面代码中,函数bar的参数func,默认是一个匿名函数,返回值为变量foo。这个匿名函数的作用域就不是bar。这个匿名函数声明时,是处在外层作用域,所以内部的foo指向函数体外的声明,输出outer。它实际上等同于下面的代码。
|
||||
|
||||
|
||||
```js
|
||||
```javascript
|
||||
let foo = 'outer';
|
||||
let f = x => foo;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user