DEV Community


Discussion on: I Don't Use JavaScript Classes At All. Am I Missing Out on Something?

darkle profile image

One particular place I find classes useful is when you want to create your own errors. In that case you can just extend the regular built in Error class and add properties to it. Then you can check for it with MyError instanceof Error.