Allows a value to be null or undefined and has a fallback.
The type of value that is being checked.
The value to check. This can be a promise that can return null or undefined in addition to the value.
The fallback value in the case that val is null or undefined.
This method returns val if it is not null or undefined, otherwise, the fallback is returned. If val is a promise and rejects, then fallback is also returned.
Allows a value to be null or undefined and has a fallback.
The type of value that is being checked.
The value to check. This can be a promise that can return null or undefined in addition to the value.
This method returns val if it is not null or undefined, otherwise, null is returned. If val is a promise and rejects, then null is also returned.
Allows a value to be null or undefined and has a fallback.
Param: val
The value to check. This can be a promise that can return null or undefined in addition to the value.
Param: fallback
The fallback value in the case that val is null or undefined.
Param: T
The type of value that is being checked.
Returns
This method returns val if it is not null or undefined, otherwise, the fallback is returned. If val is a promise and rejects, then fallback is also returned.