Created
October 12, 2012 21:35
Revisions
-
imbcmdth revised this gist
Oct 12, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ // current scope is global.. function Test(n) { this.test = n; -
imbcmdth revised this gist
Oct 12, 2012 . 1 changed file with 11 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,18 @@ // test 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); -
just2n created this gist
Oct 12, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // test is global.. var test = { test: 5, fn: function (n) { (function () { this.test = n; }()); return this.test; } }; // What does this return test.fn(1); // And this? test.fn(2);