Function getRandomValFromArray

  • Fetches a random value from the provided array.

    Type Parameters

    • T

    Parameters

    • arr: T[]

      The array to select a random value from.

    • fallbackValue: T

      A fallback value to return if the array is empty or undefined.

    Returns T

    A random value from the array or the fallback value.

Generated using TypeDoc