Returns the number of items stored in the set
Add values
to set.
Corresponding keys will be generated according to the
function provided to setMutable
, or JSON.stringify
by default.
Rest
...values: readonly V[]Value(s) to add
true if something new was added
Adds event listener.
Events
Event name
Event handler
Deletes specified value, if present.
True if value was found
Protected
fireFire event
Type of event
Arguments for event
Returns true if value is contained in Set
Remove event listener
A Set which stores unique items determined by their value, rather than object reference (unlike the default JS Set). Create with Sets.mutable. Mutable.
By default the
JSON.stringify()
representation is considered the 'key' for an object. Pass in a function toSets.mutable
to define your own way of creating keys for values. The principle should be that objects that you consider identical should have the same string key value.ISetMutable fires
add
,clear
anddelete
events.Example: Overview of functions
Example: Example usage
Example
Events