API Reference
Classes
MutSet
Mutable Set.
Methods
Name | Description |
---|---|
| Add value to set. |
| The clear() method removes all elements from a set. |
| Create an immutable shallow copy of this set. |
| Removes a specified value from a set, if it is in the set. |
| Returns a boolean indicating whether an element with the specified value exists in the set. |
| Create an immutable array shallow copy of this set. |
add
add(value: <T>): MutSet
Add value to set.
value
Required
- Type: <T>
value to add.
clear
clear(): void
The clear() method removes all elements from a set.
copy
copy(): Set
Create an immutable shallow copy of this set.
delete
delete(value: <T>): bool
Removes a specified value from a set, if it is in the set.
value
Required
- Type: <T>
The value to remove from the set.
has
has(value: <T>): bool
Returns a boolean indicating whether an element with the specified value exists in the set.
value
Required
- Type: <T>
The value to test for presence in the Set object.
toArray
toArray(): Array
Create an immutable array shallow copy of this set.
Properties
Name | Type | Description |
---|---|---|
| num | The length of the set. |
size
Required
size: num;
- Type: num
The length of the set.
Set
Immutable Set.
Methods
Name | Description |
---|---|
| Create a mutable shallow copy of this set. |
| Returns a boolean indicating whether an element with the specified value exists in the set. |
| Create an immutable array shallow copy of this set. |
copyMut
copyMut(): MutSet
Create a mutable shallow copy of this set.
has
has(value: <T>): bool
Returns a boolean indicating whether an element with the specified value exists in the set.
value
Required
- Type: <T>
The value to test for presence in the Set object.
toArray
toArray(): Array
Create an immutable array shallow copy of this set.
Properties
Name | Type | Description |
---|---|---|
| num | The length of the set. |
size
Required
size: num;
- Type: num
The length of the set.