JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow Object Right Arrow constructor

constructor  Object  instance property

Description

Returns a reference to the function that created the prototype.

  • All objects are descendants of Object.
  • All objects inherit their properties and methods from Object.prototype.

Syntax


Signature Description
anObject.constructorReturns a reference to the function that created the prototype.

Parameters

None.

Examples

The code below displays the prototype function of Object.


var o = new Object(); 
alert('Object constructor is ' + Object.constructor);

Press the button below to action the above code:

Related Tutorials

JavaScript Advanced Tutorials - Lesson 5 - Elegant Object Creation



  

go to home page Homepage go to top of page Top