matician - v2.0.0
    Preparing search index...

    Function randomSample

    • Returns a random sample of 'size' unique elements from the array.

      Type Parameters

      • T

      Parameters

      • array: T[]

        Source array.

      • size: number

        Number of elements to sample.

      Returns T[]

      A new array with sampled elements.