SortedMap

A map that provides ordering on its keys. Keys are ordered by a comparator provided at map creation time or by default as strings.

new SortedMap()

/**
 * Creates an instance of SortedMap.
 *
 * @param iterable Iterable of pairs to create the new map with.
 * @param compare Comparison function for key-value pairs sorting by key. Keys are compared as strings by default.
 */
constructor(iterable: Iterable<[K, V]> = [], protected compare: CompareFunc<K> = compareAsStrings)

size

/**
 * Number of key-value pairs in the map.
 *
 * @readonly
 */
get size(): number;

clear()

/**
 * Removes all key-value pairs from the map.
 */
clear(): void;

delete()

entries()

findGreater()

findGreaterOrEqual()

findLess()

findLessOrEqual()

findMax()

findMin()

findRange()

forEach()

get()

has()

keys()

isEmpty()

reversed()

set()

values()

[Symbol.iterator]()

Last updated

Was this helpful?