Function randomSubset

  • Pick an arbitrary subset.

    Parameters

    • x: object

      an object

    • n: number = -1

      number of entries [-1 ⇒ any]

    • fr: ReadFunction<number> = Math.random

      random number generator ([0, 1))

    Returns object

    {[kᵢ, vᵢ], [kⱼ, vⱼ], ...} | [kᵢ, vᵢ], [kⱼ, vⱼ], ... ∈ x; |{[kᵢ, vᵢ], [kⱼ, vⱼ], ...}| = |x| if n<0 else n

Generated using TypeDoc