• Swaps the elements at the given indexes of an Array.

    Mutation

    Exmaple

    const array = [1, 2, 3];

    swap(1, 2)(array);

    console.log(array); // [1, 3, 2]

    Parameters

    • indexA: number
    • indexB: number

    Returns ((array: unknown[]) => void)

      • (array: unknown[]): void
      • Parameters

        • array: unknown[]

        Returns void

Generated using TypeDoc