Skip to content

Commit

Permalink
fix: fix describe
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZhang123 authored and YuChengKai committed Aug 15, 2018
1 parent 2af1430 commit b486542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion JS/JS-ch.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ var foo = 1
}()) // -> ƒ foo() { foo = 10 ; console.log(foo) }
```

因为当 JS 解释器在遇到非匿名的立即执行函数时,会创建一个辅助的特定对象,然后将函数名称作为这个对象的属性,因此函数内部才可以访问到 `foo`但是这又个值是只读的,所以对它的赋值并不生效,所以打印的结果还是这个函数,并且外部的值也没有发生更改。
因为当 JS 解释器在遇到非匿名的立即执行函数时,会创建一个辅助的特定对象,然后将函数名称作为这个对象的属性,因此函数内部才可以访问到 `foo`但是这个值又是只读的,所以对它的赋值并不生效,所以打印的结果还是这个函数,并且外部的值也没有发生更改。

> ```js
> specialObject = {};
Expand Down

0 comments on commit b486542

Please sign in to comment.