getMapItem()function

getMapItem(map: ImmutableMap<K, T>, key: K): T | undefined
ParamType
mapImmutableMap<K, T>
The map to read from. required
keyK
The key to look up. required
Return
T | undefined
The value for key, or undefined if it doesn't exist.

Get an item in a map, or undefined if it doesn't exist.

Examples

getMapItem(new Map([["a", 1]]), "a") // 1