It's not exactly necessary, it's just another alternative to create objects. JavaScript generally offers many options to do things.
Just take into account that classes in JavaScript are just syntactic sugar for prototypes (i.e. what Alex explained in this article). That might bring some problems, especially when you have to use the this keyword.
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.
with the
class
keyword available for most browser [1], is it still necessary to use construction function?[1] caniuse.com/?search=class
It's not exactly necessary, it's just another alternative to create objects. JavaScript generally offers many options to do things.
Just take into account that classes in JavaScript are just syntactic sugar for prototypes (i.e. what Alex explained in this article). That might bring some problems, especially when you have to use the
this
keyword.