Function randomSubset

  • Pick an arbitrary subset.

    Type Parameters

    • T

    Parameters

    • x: Set<T>

      a set

    • n: number = -1

      number of values [-1 ⇒ any]

    • fr: ReadFunction<number> = Math.random

      random number generator ([0, 1))

    Returns Set<T>

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

Generated using TypeDoc