• Returns a random value from the given iterable. Throws an error if the iterable is empty.

    Type Parameters

    Type Parameters

    • T

    Parameters

    • iterable: Iterable<T>

      the iterable to return a random value from

    • generator: (() => number) = Math.random

      a function that returns a random value between 0 (inclusive) and 1 (exclusive), Math.random by default

        • (): number
        • Returns number

    Returns T

Generated using TypeDoc