JavaScript constructor Property
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





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 |
JavaScript Date object