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" ) ); // true
Type
Type of Set.prototype
is Object
.
console.log( typeof Set.prototype === "object" ); // true console.log( Object.prototype.toString.call( Set.prototype ) === "[object Set]" ); // true
Parent
Parent of Set.prototype
is Object.prototype
.
console.log( Reflect.getPrototypeOf ( Set.prototype ) === Object.prototype ); // true
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 ); // true
[see the Set Object Tutorial]
Properties
- constructor
- size
- add
- delete
- has
- clear
- forEach
- entries
- keys
- values
[Symbol.iterator]
(same asvalues
)- [Symbol.toStringTag]