Skip to content

Commit

Permalink
completed about_scope.js and added .idea to .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
liammclennan committed Nov 9, 2010
1 parent 7e6ee18 commit b37db70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.swp
.idea
7 changes: 4 additions & 3 deletions topics/about_scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ $(document).ready(function(){

test("variables declared inside of a function", function() {
var outerVariable = "outer";

var innerFunction = function() {

// this is a self-invoking function. Notice that it calls itself at the end ().
(function() {
var innerVariable = "inner";
equals(outerVariable, __, 'is outerVariable defined in this scope?');
equals(innerVariable, __, 'is innerVariable defined in this scope?');
};
})();

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

0 comments on commit b37db70

Please sign in to comment.