Function permutations

  • Obtain all possible permutations.

    Type Parameters

    • T

    Parameters

    • x: T[]

      an array

    • n: number = -1

      number of values [-1 ⇒ any]

    Returns T[][]

    [[], arrangements of length 1, of length 2, ...] if n<0; [only of length n] otherwise

Generated using TypeDoc