1
0
Fork 0
js-utils/docs/api/js-utils.getordefault.md

686 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