JavaScript Date Constructor Property

Definition and usage

In JavaScript,constructor The property returns the constructor of the object.

The return value is a reference to the function, not the name of the function:

For JavaScript dates, the constructor property returns:function Date() { [native code] }

For JavaScript numbers, the constructor property returns:function Number() { [native code] }

For JavaScript strings, the constructor property returns:function String() { [native code] }

Instance

The constructor property returns the constructor of the date:

var d = new Date();

Try it yourself

Syntax

Date.constructor

Technical details

Return value: function Date() { [native code] }
JavaScript version: ECMAScript 1

Browser Support

Properties Chrome IE Firefox Safari Opera
constructor Support Support Support Support Support

Related Pages

Tutorial:JavaScript Date

Tutorial:JavaScript Date Format

Tutorial:JavaScript Object Constructor