Methods
add(key) → {boolean}
Adds a new item to the set.
Parameters:
Name | Type | Description |
---|---|---|
key |
Object |
Returns:
Returns true if it was added to the set; false if the key is already present.
- Type
- boolean
contains() → {boolean}
Returns:
Returns true if the key is present in the set.
- Type
- boolean
remove(key) → {boolean}
Removes the item from set.
Parameters:
Name | Type | Description |
---|---|---|
key |
Returns:
Returns true if the key existed and was removed, otherwise it returns false.
- Type
- boolean
toArray() → {Array}
Returns an array containing the set items.
Returns:
- Type
- Array