Evaluates candidate synchronous or asynchronous scalars, Promises, or supplier functions in order, returning the first defined result (async lazy coalesce). Supplier functions represent deferred asynchronous work and are invoked lazily only when reached during evaluation. Rejection handlers are attached upfront to direct Promise candidates to prevent unobserved rejections if iteration short-circuits on an earlier defined candidate. If all candidates evaluate to undefined, returns undefined. Any exception or rejection thrown by an evaluated candidate bubbles directly to the caller.
A Promise resolving to the first defined value, or undefined if none resolved
Evaluates candidate synchronous or asynchronous scalars, Promises, or supplier functions in order, returning the first defined result (async lazy coalesce). Supplier functions represent deferred asynchronous work and are invoked lazily only when reached during evaluation. Rejection handlers are attached upfront to direct Promise candidates to prevent unobserved rejections if iteration short-circuits on an earlier defined candidate. If all candidates evaluate to undefined, returns undefined. Any exception or rejection thrown by an evaluated candidate bubbles directly to the caller.
One or more scalars, Promises, or async supplier functions to evaluate in sequence
A Promise resolving to the first defined value, or undefined if none resolved
Evaluates asynchronous candidates in order and stops at the first defined value.
Param: values
Values, promises, or supplier functions to evaluate.
Returns
The first defined result, or
undefinedif all candidates resolve toundefined.