Classes were added to Javascript in ECMAScript 2015 (ES6). They are not typical classes like in other object-oriented languages ie. Java.
The class in JS is helpful, facilitating syntactic sugar. It is nothing more than a regular function that receives an argument, and then this argument is assigned to the object THIS.
In the case when a class has a method, this method is assigned to the prototype of this object.
Top comments (0)