Result is a type that represents a result of an operation that may or may not be successful.
The type of the value.
The type of the error.
const result: Result<number, string> = new Ok(42);const result2: Result<number, string> = new Err('Error'); Copy
const result: Result<number, string> = new Ok(42);const result2: Result<number, string> = new Err('Error');
Result is a type that represents a result of an operation that may or may not be successful.