Skip to content

Instantly share code, notes, and snippets.

@imbcmdth
Created October 12, 2012 21:35
Show Gist options
  • Save imbcmdth/3881651 to your computer and use it in GitHub Desktop.
Save imbcmdth/3881651 to your computer and use it in GitHub Desktop.
Javascript this quiz
// 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