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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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
.