Constructor Property

Every object has a property named constructor that points to the constructor function used to create the object. This property can be used to determine the type of any object.

Constructor Property

Property Description
var obj=new Circle(5); // create a new object
var type=obj.constructor; // type = Circle

The constructor property is defined in the constructor prototype instead of in each object instance.