10 ms·
>>Cat.prototype = new Mammal() This is only useful if Mamaml has only methods and no properties which does not happen that often. >> Cat.prototype.constructor
by alexdf 13y ago
>>Cat.prototype = new Mammal()
This is only useful if Mamaml has only methods and no properties which does not happen that often.
>> Cat.prototype.constructor = Cat
I never saw a practical usage of this one :-)
I think these days the standard way of doing inheritance should be -> MyClass.prototype = Object.create(baseClass.prototype)