645 B
645 B
Home > @apextoaster/js-utils > getOrDefault
getOrDefault() function
Get a map key or default value when the key does not exist or is nil.
Signature:
export declare function getOrDefault<TKey, TVal>(map: Map<TKey, TVal>, key: TKey, defaultValue: TVal): TVal;
Parameters
Parameter | Type | Description |
---|---|---|
map | Map<TKey, TVal> | |
key | TKey | |
defaultValue | TVal |
Returns:
TVal