Function randomPrefix

  • Pick an arbitrary prefix.

    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[..i] if n<0; x[..n] otherwise | i ∈ 0..|x|

Generated using TypeDoc