We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e6ee18 commit b37db70Copy full SHA for b37db70
.gitignore
@@ -1 +1,2 @@
1
*.swp
2
+.idea
topics/about_scope.js
@@ -11,12 +11,13 @@ $(document).ready(function(){
11
12
test("variables declared inside of a function", function() {
13
var outerVariable = "outer";
14
-
15
- var innerFunction = function() {
+
+ // this is a self-invoking function. Notice that it calls itself at the end ().
16
+ (function() {
17
var innerVariable = "inner";
18
equals(outerVariable, __, 'is outerVariable defined in this scope?');
19
equals(innerVariable, __, 'is innerVariable defined in this scope?');
- };
20
+ })();
21
22
23
var isInnerVariableDefined = true;
0 commit comments