[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [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.
Signature:
```typescript
export declare function getHeadOrDefault(map: Map>>, key: TKey, defaultValue: TVal): TVal;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| map | Map<TKey, ReadonlyArray<[Optional](./js-utils.optional.md)<TVal>>> | |
| key | TKey | |
| defaultValue | TVal | |
Returns:
TVal