Skip to content

Commit b37db70

Browse files
committed
completed about_scope.js and added .idea to .gitignore
1 parent 7e6ee18 commit b37db70

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.swp
2+
.idea

topics/about_scope.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ $(document).ready(function(){
1111

1212
test("variables declared inside of a function", function() {
1313
var outerVariable = "outer";
14-
15-
var innerFunction = function() {
14+
15+
// this is a self-invoking function. Notice that it calls itself at the end ().
16+
(function() {
1617
var innerVariable = "inner";
1718
equals(outerVariable, __, 'is outerVariable defined in this scope?');
1819
equals(innerVariable, __, 'is innerVariable defined in this scope?');
19-
};
20+
})();
2021

2122
equals(outerVariable, __, 'is outerVariable defined in this scope?');
2223
var isInnerVariableDefined = true;

0 commit comments

Comments
 (0)