Javascript - Date constructor Property

In JavaScript, the constructor property returns the constructor function for an object.

Description

In JavaScript, the constructor property returns the constructor function for an object.

Syntax

Date.constructor

Return

function Date() { [native code] }

Example

The constructor property returns a date's constructor function:

Demo

//The constructor property returns the function that created the string's prototype:
var d = new Date();
console.log(d.constructor);

Result