'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:
Peter Roche 2020-06-21 03:51:06 -06:00 committed by GitHub
parent 1f7b137e64
commit e4e6a50b57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -286,7 +286,7 @@ Later, when `counter()` is called, a new Lexical Environment is created for the
![](closure-makecounter-nested-call.svg) ![](closure-makecounter-nested-call.svg)
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.**