2 ms·
Both options will break mixins. function CatDog () { Cat.apply(this, arguments); } CatDog.prototype = Object.assign(Dog.prototype, Cat.prototype);
by danShumway 9y ago
Both options will break mixins.
function CatDog () {
Cat.apply(this, arguments);
}
CatDog.prototype = Object.assign(Dog.prototype, Cat.prototype);
In the above example, CatDog is not an instance of Cat, since it never actually inherits from the Cat prototype.