JavaScript Set : Object
Sets are a collection of Objects where each object can only appear once in the set.
Instance Methods
Stores value
in this
. If value
is already stored, there is no change to
the Set. Returns this
.
Example:
RunResults:
Removes value* from
this. Returns
true if
value was in
this**
before deleting it.
Example:
RunResults:
Calls callback
for each value in this
. The Set
passed to
callback
is the this
of the call to forEach
.
Example:
RunResults:
values() : Iterator
Returns an iterator of the values in this
. The values
function is also returned for
this[Symbol.iterator]
so you can iterate over this
directly to get the values. See also entries()
and keys()
.
Example:
RunResults:
Copyright © PUBLIC Contributors