So the point is how can i change the object that this refers to?Code:function func1() {this.val = 1} function func2() {this.getVal = function() {} var inst1 = new func1(); var inst2 = new func2(); inst2.getVal(); //should return 1return this.val}




Bookmarks