Initialize a SortedMap instance, optionally with the given key-value pairs.
Optionaliterable: Iterable<[K, V], any, any>Optional iterable argument provides an initial sequence of pairs to initialize the SortedMap. Each pair in the sequence defines the key and corresponding value. If a key is seen more than once, the first key and the last value is stored in the SortedMap.
Optionaloptions: SortedArrayConstructorOptions<C>An object that specifies characteristics about the sorted container.
StaticDEFAULT_The default load factor.
Override it with option loadFactor at construction time.
Return an iterator over the sorted container.
Iterating a sorted container while adding or deleting elements may throw an error or silently fail to iterate over all elements.
Lookup value at index in sorted container.
If index is out of range, returns undefined.
The zero-based index of the desired code unit. A negative index will count back from the last item.
The item located at the specified index, or undefined if index out of range.
Return an index to insert key in the SortedMap.
If the key is already present, the insertion point will be the index of that entry.
Key to find the insertion point of.
Insertion index of key in the SortedMap.
Return an index to insert key in the SortedMap.
Similar to bisectLeft, but if value is already present, the insertion point will be after (to the right of) the existing entry.
Key to find the insertion point of.
Insertion index of key in the SortedMap.
Remove all items from the SortedMap.
Return a shallow copy of the SortedMap.
A new SortedMap instance.
Remove one value from sorted container if it is a member.
If value is not a member, do nothing.
Value to discard from SortedArray.
Returns true if an element in the SortedArray existed and has been removed, or false if the element does not exist.
Remove and return value at index in sorted container.
If the sorted container is empty or index is out of range, undefined is returned and the sorted container is not modified.
Negative indices count back from the last item.
Index of value. Negative integers count back from the last item in the array.
The removed value or undefined.
Removes elements from sorted container by index.
The zero-based location in the array from which to start removing elements. Negative integers count back from the last item in the array.
The zero-based location in the array at which to stop removing elements.
Negative integers count back from the last item in the array.
Elements up to but not including end are removed.
Return an iterator of key-value pairs over the SortedMap.
The returned iterator yields the same object on every iteration to save allocations,
so you must unpack the pair before calling .next().
Iterating a SortedMap while adding or deleting elements may throw an error or silently fail to iterate over all entries. This is different from the native Map.
Return [key, value] pair at index from the SortedMap.
Optional argument index defaults to -1, the last item in the SortedMap.
Specify index to be 0 for the first item in the sorted dict.
If the index is out of range, returns undefined.
Index of item (default -1).
Key and value pair.
Return the first element in the sorted container that is equal to the provided value. If it is not found, undefined is returned.
With the default comparator and primitive elements, this method does not tell anything beyond whether the value exists in the sorted container. However, it can turn out to be useful with a custom comparator.
The value to find.
Executes a callback function once for each key-value pair in a SortedMap.
A boolean value indicating whether an entry with the specified key exists or not.
Return the index of key in the SortedMap, or -1 if key is not present.
Index must be between start and end for the key to be considered present.
Negative indices count back from the last item.
Key in SortedMap.
Optionalstart: numberThe index at which to start the search (default 0).
Optionalend: numberThe index at which to end the search (default length).
The index of the occurrence of key in the sorted container, or -1 if it is not present.
Create an iterator of values between minimum and maximum.
Both minimum and maximum default to undefined which is automatically inclusive of the beginning and end of the sorted container.
The argument includeMinimum and includeMaximum is a pair of booleans that indicates whether the minimum and maximum ought to be included in the range, respectively.
Both arguments default to true such that the range is inclusive of both minimum and maximum.
When reverse is true the values are yielded from the iterator in reverse order; reverse defaults to false.
Iterating a sorted container while adding or deleting elements may throw an error or silently fail to iterate over all elements.
Optionalminimum: CMinimum value to start iterating.
Optionalmaximum: CMaximum value to stop iterating.
Whether the minimum ought to be included in the range.
Whether the maximum ought to be included in the range.
Whether to yield values in reverse order.
Iterator.
Return an iterator that slices sorted container from start to end.
The start and end index are treated inclusive and exclusive, respectively.
A negative index will count back from the last item.
Both start and end default to undefined which is automatically inclusive of the beginning and end of the sorted container.
When reverse is true the values are yielded from the iterator in reverse order; reverse defaults to false.
Iterating a sorted container while adding or deleting elements may throw an error or silently fail to iterate over all elements.
Start index (inclusive).
Stop index (exclusive).
Whether to yield values in reverse order.
Iterator.
Return an iterator of the SortedMap's keys.
Iterating a SortedMap while adding or deleting elements may throw an error or silently fail to iterate over all entries. This is different from the native Map.
Remove the last element from the sorted container and return it. If the sorted container is empty, undefined is returned and the sorted container is not modified.
Popped value or undefined.
Remove and return [key, value] pair at index from the SortedMap.
Optional argument index defaults to -1, the last item in the SortedMap.
Specify index to be 0 for the first item in the sorted dict.
If the index is out of range, returns undefined.
Index of item (default -1).
Key and value pair.
Return a reverse iterator over the sorted container.
Iterating a sorted container while adding or deleting elements may throw an error or silently fail to iterate over all elements.
Store an entry in SortedMap with key and corresponding value.
Keep the key but overwrite the value if the key already has an associated value.
Remove the first element from the sorted container and return it. If the sorted container is empty, undefined is returned and the sorted container is not modified.
Shifted value or undefined.
Returns a copy of a section of sorted container as an ordinary Array.
For both start and end, a negative index can be used to indicate an offset from the end of the array.
The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0.
The end index of the specified portion of the array. This is exclusive of the element at the index end.
If end is undefined, then the slice extends to the end of the array.
Return sorted container as an ordinary Array.
Return a string representation of sorted container.
Update SortedMap with entries from other.
Overwrites existing items.
other argument may be a Map, a SortedMap, an iterable of pairs.
See constructor for details.
Return the value for the entry identified by key in the SortedMap.
If key is in the SortedMap then return its value.
If key is not in the SortedMap then insert key with value default and return default.
Value of the entry after potential insertion.
Return an iterator of the SortedMap's values.
Iterating a SortedMap while adding or deleting elements may throw an error or silently fail to iterate over all entries. This is different from the native Map.
SortedMap is a sorted mutable mapping.
SortedMap keys are maintained in sorted order. The design of SortedMap is simple: SortedMap maintains a sorted array of keys and an array of values in parallel. It does not use the native Map type at all.
SortedMap is compatible with Map. A SortedMap can be used wherever a Map is expected, as long as the code relies on duck typing. SortedMap does not actually inherit Map, however.
SortedMap keys must have a total ordering. They are compared using the provided comparator function only; they do not have to be the same object to be considered equal. The total ordering of keys must not change while they are stored in the SortedMap.
Map methods and properties:
Additional methods for adding items:
Additional methods for removing items:
Additional methods for looking up items:
Miscellaneous methods:
SortedArray methods available (applies to keys):