An unordered iterable collection that cannot contain two instances of the same kind of value. It optionally enforces the type of elements that may be added to the Set.
This creates a Set that checks the type of the values.
this must be a class function/constructor.
This creates a Set that may check the types of the values.
if supplied, this must be one of: 'number' or 'string' for the key type.
Gets the number of elements in the Set.
Gets an object that you can use for iterating over the Set.
Adds a given value to the Set, if not already present.
boolean
Adds all of the values of a collection (either an Iterable or an Array) to this Set.
Clears the Set.
any
Returns whether the given value is in this Set.
boolean
Returns true if all of the values of a given collection are in this Set.
boolean
Returns true if any of the values of a given collection are in this Set.
boolean
Makes a shallow copy of this Set.
Returns the first item in the collection, or null if there is none.
any
Removes a value (if found) from the Set.
boolean
Removes all of the values of a collection from this Set.
Removes from this Set all items that are not in the given collection.
Produces a JavaScript Array from the contents of this Set.
Array<any>
Converts the Set to a List.