Constructor
A constructor is a specialized function that generates objects with the same shape and behavior. The constructor initializes this object with some data specific to the object. The concept of a constructor can be applied to most object-oriented programming languages.
In JavaScript, a constructor is usually declared within a class, but it can also be declared as a function. In fact, any function that can be called with the new
operator is a constructor.