JavaScript Date constructor Property


Advertisements


Description

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

Syntax

Its syntax is as follows −

date.constructor

Return Value

Returns the function that created this object's instance.

Example

Try the following example.

<html>
   <head>
      <title>JavaScript Date constructor Property</title>
   </head>
   
   <body>
   
      <script type="text/javascript">
         var dt = new Date();
         document.write("dt.constructor is : " + dt.constructor); 
      </script>
      
   </body>
</html>

Output

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

javascript_date_object.htm