You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/03-closure/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Different languages behave differently here, in this chapter we cover JavaScript
15
15
16
16
## A couple of questions
17
17
18
-
Let's formulate two questions for the seed, and then study internal mechanics piece-by-piece, so that you'll be able to answer these questions and more complex ones in the future.
18
+
Let's formulate two questions for the seed, and then study the internal mechanics piece-by-piece, so that you'll be able to answer these questions and more complex ones in the future.
19
19
20
20
1. The function `sayHi` uses an external variable `name`. When the function runs, which value of these two it's going to use?
21
21
@@ -176,7 +176,7 @@ sayHi(); // Pete
176
176
177
177
The execution flow of the code above:
178
178
179
-
1. The global Lexical Envrionment has `name: "John"`.
179
+
1. The global Lexical Environment has `name: "John"`.
180
180
2. At the line `(*)` the global variable is changed, now it has `name: "Pete"`.
181
181
3. When the function `say()`, is executed and takes `name` from outside. Here that's from the global Lexical Environment where it's already `"Pete"`.
182
182
@@ -565,7 +565,7 @@ Lexical Environment objects that we've been talking about are subjects to same m
565
565
return function() { alert(value); };
566
566
}
567
567
568
-
// 3 functions in array, every of them links to LexicalEnvrironment
568
+
// 3 functions in array, every of them links to Lexical Environment
0 commit comments