705 B
705 B
Home > @apextoaster/js-utils > setOrPush
setOrPush() function
Set a map key to a new array or push to the existing value.
Signature:
export declare function setOrPush<TKey, TVal>(map: Map<TKey, Array<TVal>>, key: TKey, val: TVal | Array<TVal>): void;
Parameters
Parameter | Type | Description |
---|---|---|
map | Map<TKey, Array<TVal>> |
|
key | TKey |
|
val | TVal | Array<TVal> |
Returns:
void