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