• Randomizes the order of the specified collection in-place, using the Fisher–Yates shuffle.

    Parameters

    • arr: any[]
    • rnd: (() => number) = Math.random
        • (): number
        • Returns a pseudorandom number between 0 and 1.

          Returns number

    Returns any[]

    the collection shuffled

    Function

    Example

    shuffle(["C", "D", "E", "F"]) // => [...]