JavaScript's - class, constructor, methods

JavaScript's (OOJS) Today's topic - javascript class, constructor, methods What are classes? If i say in really simple words classes are the blueprint/template for creating objects. As you wish to call them, by using classes we can make a reusable block of code which we can use anywhere in our current project or in any other project where we need the same functionality. Classes in javaScript are built based on prototypes. Defining classes - Classes are basically the same as functions or you can also say they are a kind of special functions. So basically the classes have three parts as follows: Class creation You can use the class keyword to create a new class followed by the class name. Eg - Class creation. The constructor method So basically constructor is a special method of class. It is executed automatically when the object is created. The use of constructor is to initialize object properties. constructor is created using the keyword constructor . Eg...