Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript constructor Property

JavaScript constructor Property

Date Object Reference JavaScript Date object

Example

Return the function prototype that created the Date object:

myDate.constructor;

Result output:

function Date() { [native code] }

Try it »


Definition and Usage

The constructor property returns a reference to the Date function that created this object.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the constructor property.


Syntax

Date

.constructor

Technical Details

Return Value: A function object. The function prototype of the Date object.
JavaScript version: 1.1

Date Object Reference JavaScript Date object