JS: Date (class)
What is the Keyword βDateβ
Date
is the value of the property key "Date"
of the Global Object
.
console.log(globalThis["Date"] === Date);
Type
Type of Date
is a function.
typeof Date === "function"
Parent
Parent of Date
is Function.prototype.
Reflect.getPrototypeOf ( Date ) === Function.prototype
Purpose
Purpose of Date
is:
- To create date objects.
- Used as a namespace to hold static methods.
- Holds the property key
"prototype"
. Its value is the parent of all instance of date.