DEV Community

Discussion on: Getting Started With JavaScript Constructor Functions

Collapse
 
nicozerpa profile image
Nico Zerpa (he/him)

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.