Returns an AsyncOperationFunction that yields the defaultValue parameter if the source Iterable is empty.
The type of the elements in the source Iterable.
The value or factory to use when the source Iterable is empty.
An AsyncOperationFunction that yields the defaultValue parameter if the source Iterable is empty.
const result = defaultIfEmptyAsync<number>([], 0);console.log(result); // [0] Copy
const result = defaultIfEmptyAsync<number>([], 0);console.log(result); // [0]
Returns an AsyncOperationFunction that yields the defaultValue parameter if the source Iterable is empty.