There’s always been a ton of controversy about “how OOP” js is, and how it should or shouldn’t implement subclassing structures. Most of the loudest names in JS dev have chimed in about it – and some libraries spend a lot of time working around a pretty basic concept.

Here’s the upshot (!)

That’s it. If you have a class called Animal and you want to subclass a Bear, you just use:

You’re free to add prototype members (or static ones if you prefer) as normal.

The above is the bare (pun-intended) minimum – you can easily modify to include a super() method or reference, or list child classes, etc.