Skip to content

getPreviousMapEntry

getPreviousMapEntry<K, V>(map, currentKey): undefined | [K, V]

Defined in: utils/map.ts:8

Returns the map entry that comes before the entry with the provided key. If the provided key is the first entry in the map or doesn’t exist in the map, the function returns undefined.

K = any

V = any

Map<K, V>

The map to search in.

any

The key of the map entry that comes after the desired entry.

undefined | [K, V]

The map entry that comes before the entry with the provided key, or undefined if such an entry doesn’t exist.