Merge pull request #1424 from jamesblckwell/patch-1

Fixed typo on line 366
This commit is contained in:
Ilya Kantor 2019-10-10 10:59:53 +03:00 committed by GitHub
commit 3bd57892c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -363,7 +363,7 @@ Please note the additional `[[Environment]]` property is covered here. We didn't
![](lexenv-nested-makecounter-5.svg)
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.