nullishOr()
nullishOr<
A
>(a
): <B
>(b
) =>B
|NonNullable
<A
>
Nullish Coalescing (a ?? b)
.
Type Parameters
• A
The type of the first input value.
Parameters
a
A
The possible null value.
Returns
Function
Type Parameters
• B
Parameters
b
B
Returns
B
| NonNullable
<A
>
Remark
pure function
Example
nullishOr(null)(4);
// 4