constructor  Object  instance property JS Home  <<  JS Reference  <<  Object  <<  constructor

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

JavaScript Basics

JavaScript Basics

JavaScript Intermediate

JavaScript Intermediate

JavaScript Advanced

JavaScript Advanced

JavaScript Reference

JavaScript Entities

Globals

Object

Class Properties
prototype
Instance Properties
constructor
Class Methods
None.
Instance Methods Getters
hasOwnProperty()
isPrototypeOf()
toLocaleString()
toString()
valueOf()
Instance Methods Setters
None.

Statements

Operators