Possible Duplicate:
Javascript multiple inheritance
Is there a way in JavaScript to do this:
Foo = function() {
};
Bar = function() {
};
Baz = function() {
Foo.call(this);
Bar.call(this);
};
Baz.prototype = Object.create(Foo.prototype, Bar.prototype);
var b = new Baz();
console.log(b);
console.log(b instanceof Foo);
console.log(b instanceof Bar);
console.log(b instanceof Baz);
So that Baz is both an instance of Foo and Bar?