The conttructor property returns a reference to the object constructor function that has created the instance of an object. The value of the constructor is not a string containing the function’s name, but it is a reference to the function itself.
Return Value: It is a reference to the object of constructor.
Example 1: Below example illustrates how to display the constructor of an object.
Example 2: Below example illustrates how to change the constructor of an object.
- Chrome 1 and above
- Edge 12 and above
- Firefox 1 and above
- Internet Explorer 11 and above
- Opera 9.5 and above
- Safari 3 and above