The type of the contained value.
ReadonlyvalueThe contained value of type A, if Option.isSome() is true. If
Option.isNone() is true, there's no value and the type is never.
If the Option isn't empty, call the provided function with the contained value and return the result of the function, which must be another Option. If the Option is empty, return None without calling the function.
This is the monadic bind function, for those who celebrate.
Test if the Option is empty.
A nullable value of type
A.Option<A>is essentially the same asA | undefined, but with a lot of useful methods attached, and with the ability to distinguish between a missing value and a present value that'sundefined.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'sA | undefinedinto an Option by calling Option.from.