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