Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 633 Bytes

js-utils.defaultwhen.md

File metadata and controls

25 lines (15 loc) · 633 Bytes

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