661 B
661 B
Home > @apextoaster/js-utils > defaultWhen
defaultWhen() function
Return the first element when condition
is true and the second element when condition
is false.
Signature:
export declare function defaultWhen<TVal>(condition: boolean, ...items: Array<TVal>): TVal;
Parameters
Parameter | Type | Description |
---|---|---|
condition | boolean |
|
items | Array<TVal> |
Returns:
TVal