function sort( compareFunction ) {
			var clbk;
			var tmp;
			var i;
			var j;
			var k;
			var v;
			if ( this !== tuple ) { // eslint-disable-line no-invalid-this
				throw new TypeError( 'invalid invocation. `this` is not host tuple.' );
			}
			if ( arguments.length ) {
				if ( !isFunction( compareFunction ) ) {
					throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFunction ) );
				}
				clbk = compareFunction;
			} else {
				clbk = ascending;
			}
			indices.sort( wrapper );

			// Create a temporary indices array which we'll reorder as we rearrange the tuple elements:
			tmp = indices.slice();

			// Rearrange tuple elements according to the rearranged indices (note: every "move" moves a tuple element to its desired position with runtime complexity O(N))...
			for ( i = 0; i < nfields; i++ ) {
				// Check if we need to move a tuple element:
				if ( tmp[ i ] !== i ) {
					v = tuple[ i ];
					j = i;
					k = tmp[ j ];

					// Follow "cycles", stopping once we are back at index `i`...
					while ( k !== i ) {
						tuple[ j ] = tuple[ k ];
						tmp[ j ] = j;
						j = k;
						k = tmp[ j ];
					}
					tuple[ j ] = v;
					tmp[ j ] = j;
				}
			}
			return tuple;

			/**
			* Wraps a comparison function to allow sorting the internal indices array rather than the tuple directly.
			*
			* @private
			* @param {NonNegativeInteger} ia - first index
			* @param {NonNegativeInteger} ib - second index
			* @returns {*} value specifying the sort order
			*/
			function wrapper( ia, ib ) {
				var a = tuple[ indices[ ia ] ];
				var b = tuple[ indices[ ib ] ];
				return clbk( a, b );
			}
		}
Sorts a tuple in-place.

## Notes

-   The comparison function is provided two tuple elements, `a` and `b`, per invocation, and its return value determines the sort order as follows:

    -   If the comparison function returns a value **less** than zero, then the function sorts `a` to an index lower than `b` (i.e., `a` should come **before** `b`).
    -   If the comparison function returns a value **greater** than zero, then the function sorts `a` to an index higher than `b` (i.e., `b` should come **before** `a`).
    -   If the comparison function returns **zero**, then the relative order of `a` and `b` _should_ remain unchanged.

-   Invoking this method does **not** affect tuple field assignments.

@private
@memberof tuple
@param {Function} [compareFunction] - function which specifies the sort order
@throws {TypeError} `this` must be the host tuple
@throws {TypeError} first argument must be a function
@returns {TypedArray} sorted tuple