In Javascript, I was searching for how to inherit an object when constructor has arguments. And i found the answer for this question.
Now I need to inherit two parent object to a child object, but the argument of the 2nd inherited object is the first inherited object. How to do this?
In the difficult way:
function ChildObj() {
this.Parent1 = new ParentObj1 ( arguments );
this.Parent2 = new ParentObj2 ( this.Parent1);
}
But how to do it in this way:
function ChildObj() {
Parent1Obj.call ( this, arguments ) ;
Parent2Obj.call( this, <<-- how to indicate Parent1Obj as argument -->> ) ;
}