JS: Date (class)
What is the Keyword βDateβ
Date is the value of the property key "Date" of the Global Object
.
console.assert(globalThis["Date"] === Date);
Type
Type of Date is a function.
console.assert(typeof Date === "function");
Parent
Parent of Date is Function.prototype.
console.assert(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.