Was this page helpful?
HashSet¶
HashSet()
Represents a unique set of values.
Constructor¶
new HashSet()
Source
Methods¶
add()
Adds a new item to the set.
Source
Returns:
Returns true if it was added to the set; false if the key is already present.
contains()
Source
Returns:
Returns true if the key is present in the set.
remove(key)
Removes the item from set.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
Source
Returns:
Returns true if the key existed and was removed, otherwise it returns false.
toArray()
Returns an array containing the set items.
Source