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: page/javascript-101/scope.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ myFunc();
49
49
console.log( x ); // 5
50
50
```
51
51
52
-
This is a bad idea. Any variable that is global can have its value changed by any other parts of a program or any other script. This is undesirable, as it could lead to unforseen side effects.
52
+
This is a bad idea. Any variable that is global can have its value changed by any other parts of a program or any other script. This is undesirable, as it could lead to unforeseen side effects.
53
53
54
54
Secondly, Immediately-Invoked Function Expressions provide a way to avoid global variables. You'll see many libraries such as jQuery often use these:
0 commit comments