Skip to main content
Question Protected by Daniel Kaplan
Whats' -> What's
Link
Josh Gibson
  • 22.6k
  • 28
  • 70
  • 63

Whats' What's a good way to extend Error in JavaScript?

Source Link
Josh Gibson
  • 22.6k
  • 28
  • 70
  • 63

Whats' a good way to extend Error in JavaScript?

I want to throw some things in my JS code and I want them to be instanceof Error, but I also want to have them be something else.

In Python, typically, one would subclass Exception.

What's the appropriate thing to do in JS?