'where finds it and changes' -> 'where it finds and changes it'
Was tempted to suggest something a bit wordier: "where it finds it and, in this case, changes it", but I thought this would do.
This commit is contained in:
parent
1f7b137e64
commit
e4e6a50b57
1 changed files with 1 additions and 1 deletions
|
@ -286,7 +286,7 @@ Later, when `counter()` is called, a new Lexical Environment is created for the
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Now when the code inside `counter()` looks for `count` variable, it first searches its own Lexical Environment (empty, as there are no local variables there), then the Lexical Environment of the outer `makeCounter()` call, where finds it and changes.
|
Now when the code inside `counter()` looks for `count` variable, it first searches its own Lexical Environment (empty, as there are no local variables there), then the Lexical Environment of the outer `makeCounter()` call, where it finds and changes it.
|
||||||
|
|
||||||
**A variable is updated in the Lexical Environment where it lives.**
|
**A variable is updated in the Lexical Environment where it lives.**
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue