• Swap an array item to a different position. Returns a new array with the item swapped to the new position.

    Type Parameters

    • T

    Parameters

    • array: T[]
    • from: number
    • to: number

    Returns T[]