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

26 lines
633 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; [defaultWhen](./js-utils.defaultwhen.md)
## defaultWhen() function
Return the first element when `condition` is true and the second element when `condition` is false.
<b>Signature:</b>
```typescript
export declare function defaultWhen<TVal>(condition: boolean, ...items: Array<TVal>): TVal;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| condition | boolean | |
| items | Array&lt;TVal&gt; | |
<b>Returns:</b>
TVal