Overview
Constructs anOk variant of Result. This represents a successful computation with a value.
Signature
Parameters
The success value to wrap in an Ok result. Can be any type including
null, undefined, or void.Returns
Returns anOk<T, E> instance containing the provided value.
Examples
Basic Usage
With Null or Undefined
Type Annotations
Related
- err() - Create an Err variant
- Result.isOk() - Check if a Result is Ok
- Result.isErr() - Check if a Result is Err