method Result.prototype.unwrapOrElse Result.prototype.unwrapOrElse<U>(fn: (error: E) => U): T | U Returns the Ok value or computes a default from the error. Examples Example 1 const value = result.unwrapOrElse(error => { console.error(error); return 0; }); Type Parameters U The type of the default value Parameters fn: (error: E) => U Function to compute the default value from the error Return Type T | U The Ok value or the computed default value