I work on a project that uses classes in JS. So far I've already used 3 different ways to do inheritance:<p>- Subclass.prototype = new Class()<p>- Subclass.prototype = Object.create( Class.prototype )<p>- Fiber: https://github.com/linkedin/Fiber<p>None of those solutions were acceptable: the two firsts have issues with method overriding and super() invocation, the latter is too verbose to implement.<p>It seems that most articles on the subject link to John Resig's Simple Javascript Inheritance: http://ejohn.org/blog/simple-javascript-inheritance/, but that one is from 2008 and I was wondering if there's one "modern" way to do JS inheritance and that most people agree on.<p>Is there such a thing? Is there a library that implements it?<p>Side note: Please avoid things like "you're trying to do things that JS is not meant for", I'm just trying to answer the how, not the why.
I think your best bet would be going with something like node.js' util.inherits, a standalone version for the browser can be found here:<p><a href="https://github.com/isaacs/inherits" rel="nofollow">https://github.com/isaacs/inherits</a>