Function nothing

Create a Maybe instance which is a Nothing.

If you want to create an instance with a specific type, e.g. for use in a function which expects a Maybe<T> where the <T> is known but you have no value to give it, you can use a type parameter:

const notString = Maybe.nothing<string>();

The type of the item contained in the Maybe.

An instance of Maybe.Nothing<T>.

  • Create an instance of Maybe.Nothing.

    If you want to create an instance with a specific type, e.g. for use in a function which expects a Maybe<T> where the <T> is known but you have no value to give it, you can use a type parameter:

    const notString = Maybe.nothing<string>();
    

    Type Parameters

    • T

      The type of the item contained in the Maybe.

    Parameters

    • Optional_: null

    Returns Nothing<T>

    An instance of Maybe.Nothing<T>.