isMapItem()function
isMapItem(map: ImmutableMap<K, V>, key: unknown): key is K
| Param | Type | |
|---|---|---|
map | ImmutableMap<K, V> | The map to look in. required |
key | unknown | The candidate key to test. required |
| Return | |
|---|---|
key is K | true if key exists in map, otherwise false. |
Is an unknown value a key for an item in a map?
Examples
isMapItem(new Map([["a", 1]]), "a") // true