Construct a new string-based dictionary.
const d = new StringDict<number>()
You can also constrcut this dictionary from any iterable, like so:
const d = new StringDict([
['one', 1],
['two', 2]
])
Count the amount of elements in the collection.
⚠️ In most cases, this should be an O(1)
operation. However, there are
cases where this can be an O(n)
operation. Therefore, it is recommended
to always cache the result in a local variable.
Returns an object which is able to sift through the values in this collection.
The order by which the elements are traversed depends on the kind of collection. For unordered collections, the iteration order is unspecified and may even differ between two iterations on the same collection.
Remove all elements from this collection, effectively setting the collection to the empty collection.
Copies all elements in the collection to a new one of the same kind.
Converts the entire collection to a range.
Generated using TypeDoc
A hash-based dictionary for strings, which wraps a native JavaScript object to provide very fast lookup, insertion and deletion.
When two items are added with the same key, the second item will override the first.
All operations in the dictionary are in
O(1)
.