ES6 - Date Property Constructor



Javascript date constructor property returns a reference to the array function that created the instance's prototype.

Syntax

date.constructor

Return value

Returns the function that created this object's instance.

Example: constructor

var dt = new Date(); 
console.log("dt.constructor is : " + dt.constructor); 

The following output is displayed on successful execution of the above code.

dt.constructor is : function Date() { [native code] }
Advertisements