@unikue/ts-lang-utils
    Preparing search index...

    Function singleton

    • Returns an array that only contains the given element

      Type Parameters

      • E

      Parameters

      • Optionalelement: E | null

        The element to wrap

      Returns E[] | undefined

      an array that only contains the given element

      David Hsing

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