Function randomPermutation

  • Pick an arbitrary permutation.

    Type Parameters

    • T

    Parameters

    • x: T[]

      an array

    • n: number = -1

      number of values [-1 ⇒ any]

    • fr: ReadFunction<number> = Math.random

      random number generator ([0, 1))

    Returns T[]

    x' | x' = x; values are randomly shuffled

Generated using TypeDoc