Constructor
Aconstructor is a specializedfunction that generatesobjects 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 mostobject-oriented programming languages.
InJavaScript, a constructor is usually declared within aclass, but it can also be declared as afunction. In fact, any function that can be called with thenew operator is a constructor.