Skip to content

Commit 1cfd422

Browse files
committed
minor fixes
1 parent 8d13b7f commit 1cfd422

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11

22
# Variable scope
33

4-
JavaScript is a very function-oriented language. It gives us a lot of freedom. A function can be created dynamically, passed as an argument to another function and called from a totally different place of code later.
4+
JavaScript is a very function-oriented language. It gives us a lot of freedom. A function can be created at any moment, passed as an argument to another function, and then called from a totally different place of code later.
55

66
We already know that a function can access variables outside of it.
77

8-
Now let's expand our knowledge to include more complex scenarios.
8+
But what happens if these "outer" variables change since a function is created? Will the function see newer values the old ones?
9+
10+
And if a function is passed along as a parameter and called from another place of code, will it get access to outer variables at the new place?
11+
12+
Let's expand our knowledge to understand these scenarios and more complex ones.
913

1014
```smart header="We'll talk about `let/const` variables here"
1115
In JavaScript, there are 3 ways to declare a variable: `let`, `const` (the modern ones), and `var` (the remnant of the past).

0 commit comments

Comments
 (0)