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

    Function singleton

    • Returns an array that only contains the given element

      Type Parameters

      • E

      Parameters

      • Optionalelement: null | E

        the element to wrap

      Returns undefined | E[]

      an array that only contains the given element

      David Hsing

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