Type Alias Option<A>

Option<A>: (Some<A> | None) & IOption<A>

Option<A> provides a nullable value of type A. It's essentially the same as A | undefined but with a lot of useful methods attached.

You can construct an Option using either the Some function to wrap a present value of A, or the value None to signify a null value. You can also convert a value that's A | undefined into an Option by calling Option.from.

Type Parameters

  • A

    The type of the contained value.