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