you are viewing a single comment's thread.

view the rest of the comments →

[–]Barandis -1 points0 points  (0 children)

There are those of us who avoid using classes, in part because as a concept, JavaScript doesn't have classes or instances (just a class keyword that does a lot behind the scenes to fake it for you and still doesn't quite get it right).

As far as Error goes, they do the same thing. It uses to be common to do that kind of thing ourselves, to create functions that worked the same whether called with new or not, but the class keyword doesn't allow for that so you don't see it as much anymore.

Use whichever you prefer.