Fixed typo on line 366
"Now when the call looks for `count` variable, it first searches its own Lexical Environment (empty), then the Lexical Environment of the outer `makeCounter()` call, where finds it." to "Now when the call looks for `count` variable, it first searches its own Lexical Environment (empty), then the Lexical Environment of the outer `makeCounter()` call, where it finds it."
This commit is contained in:
parent
a88e082ef9
commit
f24a6e577b
1 changed files with 1 additions and 1 deletions
|
@ -363,7 +363,7 @@ Please note the additional `[[Environment]]` property is covered here. We didn't
|
|||
|
||||

|
||||
|
||||
Now when the call looks for `count` variable, it first searches its own Lexical Environment (empty), then the Lexical Environment of the outer `makeCounter()` call, where finds it.
|
||||
Now when the call looks for `count` variable, it first searches its own Lexical Environment (empty), then the Lexical Environment of the outer `makeCounter()` call, where it finds it.
|
||||
|
||||
Please note how memory management works here. Although `makeCounter()` call finished some time ago, its Lexical Environment was retained in memory, because there's a nested function with `[[Environment]]` referencing it.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue