This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

constructor

Summary

Specifies the function that creates a date.

Syntax

date.constructor

Examples

The following example illustrates the use of the constructor property.

var x = new Date("Hi");

 if (x.constructor == Date)
     document.write("Object is a date.");

 // Output:
 // Object is a date.

Remarks

The required date is the name of a date object.

The constructor property is a member of the prototype of every object that has a prototype. The constructor property contains a reference to the function that constructs instances of that particular object.

Attributions

  • Microsoft Developer Network: Article