3 ms·
Why? Javascript isn't class based. Why not embrace the paradigm of the language you're using?
by news_to_me 13y ago
Why? Javascript isn't class based. Why not embrace the paradigm of the language you're using?
- TazeTSchnitzel 13y agoES6 adds minimal JS classes, which I'm a fan of. They're just syntactic sugar over: Animal = function () {}; Dog = function () {}; Dog.prototype = Object.create(Animal); But this? This is an abomination.
- kybernetikos 13y agothat's Object.create(Animal.prototype), and they do add a little more, like a working 'super', and getting the .constructor property right.