JavaScript: Date Object
Date
is the value of the property key "Date"
of the Global Object
.
console.log( window.Date === Date );
Type
Type of Date
is a function.
console.log( typeof Date === "function" );
Parent
Parent of Date
is Function.prototype.
console.log( Reflect.getPrototypeOf ( Date ) === Function.prototype );
Purpose
Purpose of Date
is:
- To create a date instance. (by
new Date(âŠ)
) - Used as a namespace to hold static methods for working with date. For example,
Date.parse(string)
. - Holds the property key
"prototype"
. The value ofDate.prototype
is the root parent object of all date instances. [see Prototype and Inheritance]