Swaps the position of two elements in the given array. The elements must exist in the same array. The array is modified in-place.
name | type | description |
---|---|---|
array | array |
The input array. |
item1 | * |
The first element to swap. |
item2 | * |
The second element to swap. |
The input array.