• Given an array anArray and two indices i and j, exchange the values at these indices.

    Parameters

    • anArray: any[]

      the array whose values are swapped

    • i: number

      the first index to be swapped

    • j: number

      the second index to be swapped

    Returns void

    • the swap is done in place