i know how to do inheritance in javascript but i can only inherit a single object. eg.
function fun1() {
this.var1=10;
this.meth1=function() {
...
...
};
}
function fun2() {
this.var2=20;
this.meth2=function() {
...
...
};
}
function fun3() {
this.var3=30;
this.meth3=function() {
...
...
};
}
now if i want an fun3
object to inherit fun1
object i can do this
fun3.prototype=new fun1();
or to inherit fun2
object i can do this
fun3.prototype=new fun2();
but how can i inherit both fun1
and fun2
?