• Returns an array that only contains the given element

    Type Parameters

    • E

    Parameters

    • Optionalelement: null | E

      the element to wrap

    Returns E[] | undefined

    an array that only contains the given element

    singleton('foobar');    // ['foobar']