getDictionaryItem()function
getDictionaryItem(dict: ImmutableDictionary<T>, key: string): T | undefined
| Param | Type | |
|---|---|---|
dict | ImmutableDictionary<T> | The dictionary to read the item from. required |
key | string | The key of the item to read. required |
| Return | |
|---|---|
T | undefined | The value of the item, or undefined if key is not an own prop of dict. |
Get an item in a dictionary object, or undefined if it doesn't exist.
Examples
getDictionaryItem({ a: 1 }, "a"); // 1