Created
May 18, 2012 23:45
-
-
Save c4milo/2728203 to your computer and use it in GitHub Desktop.
Revisions
-
c4milo created this gist
May 18, 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,19 @@ var MyClass = function() { this.cosa = 0; console.log('constructor'); }; (function() { var func1 = function() { console.log('func1'); console.log(this.cosa); }.bind(this); this.func2 = function() { console.log('func2'); func1(); }; }).call(MyClass.prototype); var i = new MyClass(); i.func2();