The input array.
The mutable array-like data structure that is sorted in-place.
Optional
swap: ((i: number, j: number) => void)The callback that is invoked with indices that were swapped.
Optional
comparator: Comparator<ArrayValue<T>>The callback that defines the sort order. If omitted, the array elements are compared using comparison operators.
The input array.
Sorts the array in-place using an optional comparator and invokes a callback after a pair of elements was swapped.
swap or comparator callbacks are guaranteed to be called after the elements of arr are swapped.