Type alias SwapFunction<T>

SwapFunction<T>: ((x, i, j) => T[])

Type Parameters

  • T

Type declaration

    • (x, i, j): T[]
    • Handle swapping of two values in an array.

      Parameters

      • x: T[]

        an array (updated!)

      • i: number

        an index

      • j: number

        another index

      Returns T[]

      x | x[i] ⇔ x[j]

Generated using TypeDoc