Skip to content

Commit ba22101

Browse files
authored
Update article.md
Minor fixes
1 parent 95f61ee commit ba22101

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1-js/06-advanced-functions/03-closure/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Let's consider two situations to begin with, and then study the internal mechani
6363

6464
To understand what's going on, let's first discuss what a "variable" actually is.
6565

66-
In JavaScript, every running function, code block `{...}`, and the script as a whole has an internal (hidden) associated object known as the *Lexical Environment*.
66+
In JavaScript, every running function, code block `{...}`, and the script as a whole have an internal (hidden) associated object known as the *Lexical Environment*.
6767

6868
The Lexical Environment object consists of two parts:
6969

@@ -117,7 +117,7 @@ The code below demonstrates that the Lexical Environment is non-empty from the b
117117

118118
Now let's go on and explore what happens when a function accesses an outer variable.
119119

120-
During the call, `say()` uses the outer variable `phrase`, let's look at the details of what's going on.
120+
During the call, `say()` uses the outer variable `phrase`. Let's look at the details of what's going on.
121121

122122
When a function runs, a new Lexical Environment is created automatically to store local variables and parameters of the call.
123123

@@ -149,7 +149,7 @@ The inner Lexical Environment has a reference to the `outer` one.
149149
150150
**When the code wants to access a variable -- the inner Lexical Environment is searched first, then the outer one, then the more outer one and so on until the global one.**
151151
152-
If a variable is not found anywhere, that's an error in strict mode (without `use strict`, an assignment to a non-existing variable, like `user = "John"` creates a new global variable `user`, that's for backwards compatibility).
152+
If a variable is not found anywhere, that's an error in strict mode. Without `use strict`, an assignment to a non-existing variable like `user = "John"` creates a new global variable `user`. That's for backwards compatibility.
153153
154154
Let's see how the search proceeds in our example:
155155

0 commit comments

Comments
 (0)