News for hackers. Stuff that matters.
Re:Javascript Constructors and Prototypes by alexdf on Thursday August 01, 2013 @07:17AM (#6139529)
>>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)

There are no comments on this comment yet.