Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>>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)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: