Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 3
    In fairness, and keep in mind: this question was asked 12 years before you answered. extends, class, and super were all added in ES2015, several years after OP's initial query. Not knocking your approach; just tossing in a word of defense for some of the the other answers is all. Speaking as someone who's been a full-time FED since '96, let me assure you: there's a LOT of stuff that's WAY less complicated now, lol.
    – NerdyDeeds
    Commented Sep 21, 2022 at 8:45
  • Be aware that this.constructor.name cannot be used with bundlers that mangle class or function names, because the error class name in the minified code might be shortened. Commented Dec 3, 2023 at 21:26