JavaScript: Set.prototype
New in JS2015.
Set.prototype
is the value of the property key "prototype"
of the function Set
. [see Set Object]
console.log(Set.hasOwnProperty("prototype"));
Type
Type of Set.prototype
is Object
.
console.log(typeof Set.prototype === "object");
Parent
Parent of Set.prototype
is Object.prototype
.
console.log(Reflect.getPrototypeOf(Set.prototype) === Object.prototype);
Purpose
Purpose of Set.prototype
is to provide methods and properties useful for all set instances.
Set.prototype
is the parent of all set instances.
console.log(Reflect.getPrototypeOf(new Set()) === Set.prototype);
[see the Set Object Tutorial]
Properties
- constructor
- size
- add
- delete
- has
- clear
- forEach
- entries
- keys
- values
[Symbol.iterator]
(same asvalues
)- [Symbol.toStringTag]