Swapped function
Fully qualified name: Std.Arrays.Swapped
function Swapped<'T>(firstIndex : Int, secondIndex : Int, array : 'T[]) : 'T[]
Applies a swap of two elements in an array.
Index of the first element to be swapped.
Index of the second element to be swapped.
Array with elements to be swapped.
The array with the in place swap applied.
// The following returns [0, 3, 2, 1, 4]
Swapped(1, 3, [0, 1, 2, 3, 4]);