• Returns a random object from the given array

    Type Parameters

    • T

    Parameters

    • array: T[]

      the array to get the object from

    • Optional index: number

      the index to get the object from

    • useIndex: boolean = true

      if true, the index will be used instead of a random index

    Returns T

    the item found