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
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@
3
3
4
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.
5
5
6
-
We already know that a function can access variables outside of it.
6
+
We already know that a function can access variables outside of it ("outer" variables).
7
7
8
-
But what happens if these "outer" variables change since a function is created? Will the function see newer values the old ones?
8
+
But what happens if outer variables change since a function is created? Will the function get newer values or the old ones?
9
9
10
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?
0 commit comments