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

27 lines
805 B
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [@apextoaster/js-utils](./js-utils.md) &gt; [getHeadOrDefault](./js-utils.getheadordefault.md)
## getHeadOrDefault() function
Get the first element from the specified key, within a map of lists, or a default value when the key does not exist or is nil.
<b>Signature:</b>
```typescript
export declare function getHeadOrDefault<TKey, TVal>(map: Map<TKey, Array<Optional<TVal>>>, key: TKey, defaultValue: TVal): TVal;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Map&lt;TKey, Array&lt;Optional&lt;TVal&gt;&gt;&gt;</code> | |
| key | <code>TKey</code> | |
| defaultValue | <code>TVal</code> | |
<b>Returns:</b>
`TVal`