• Returns a random element of the array

    Type Parameters

    • E

    Parameters

    • Optionalarray: E[]

      the array to random

    Returns E | undefined

    a random element of the array

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