JS: Set.prototype
(new in ECMAScript 2015)
What is Set.prototype
Set.prototype is the value of the property key "prototype" of the function Set. 〔see Set Object〕
console.assert(Object.hasOwn(Set, "prototype"));
Type
Type of Set.prototype is Object
.
console.assert(typeof Set.prototype === "object");
Parent
Parent of Set.prototype is Object.prototype
.
console.assert(Reflect.getPrototypeOf(Set.prototype) === Object.prototype);
Purpose
Purpose of Set.prototype is to provide methods and properties useful for all set objects.
Set.prototype is the parent of all set objects.
console.assert(Reflect.getPrototypeOf(new Set()) === Set.prototype);
〔see the Set Object Tutorial〕
Properties
- JS: Set.prototype.size
- JS: Set.prototype.add
- JS: Set.prototype.delete
- JS: Set.prototype.has
- JS: Set.prototype.clear
- JS: Set.prototype.union
- JS: Set.prototype.intersection
- JS: Set.prototype.difference
- JS: Set.prototype.symmetricDifference
- JS: Set.prototype.isSubsetOf
- JS: Set.prototype.isSupersetOf
- JS: Set.prototype.isDisjointFrom
Set.prototype[Symbol.iterator](same as Set.prototype.values)- JS: Set.prototype[Symbol.toStringTag]