Constructor, classes, and object are the foundation of OOPS language. In javascript, we also use constructor, classes, and object. I will explain this by using a simple example but before starting this we should know what is constructor, classes, and object
Constructor:
The constructor is called at the moment of instantiation. In other words, we can say that when we will create the object of any instance then constructor will call.
In JavaScript the function serves as the constructor of the object, therefore, there is no need to explicitly define a constructor method. Every action declared in the class gets executed at the time of instantiation.