Created
October 12, 2012 21:35
-
-
Save imbcmdth/3881651 to your computer and use it in GitHub Desktop.
Javascript this quiz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// current scope is global.. | |
function Test(n) { | |
this.test = n; | |
var bob = function (n) { | |
this.test = n; | |
}; | |
this.fn = function (n) { | |
bob(n); | |
return this.test; | |
} | |
} | |
var test = new Test(5); | |
// What does this return | |
test.fn(1); | |
// And this? | |
test.fn(2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment