getDictionaryItem()function

getDictionaryItem(dict: ImmutableDictionary<T>, key: string): T | undefined
ParamType
dictImmutableDictionary<T>
The dictionary to read the item from. required
keystring
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