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

    Function randomElements

    • Returns a random element array with the specified length within the given array

      Type Parameters

      • E

      Parameters

      • Optionalarray: E[]

        the array to random

      • Optionalsize: number

        the size to generate

      Returns undefined | E[]

      a random element array with the specified length within the given array

      David Hsing

      randomElements(['1', '2', '3'], 2);