function order( x ) {
	var arr;
	var i;

	arr = new Array( x.length );
	for ( i = 0; i < x.length; i++ ) {
		arr[ i ] = i;
	}
	return arr.sort( compare );

	/**
	* Compare the elements of the input array.
	*
	* @private
	* @param {number} a - first number
	* @param {number} b - second number
	* @returns {boolean} comparison result
	*/
	function compare( a, b ) {
		return compareFunction( x[a], x[b] );
	}
}
Returns a permutation which rearranges input array.

@private
@param {ArrayLike} x - input array-like object
@returns {Array} permutation array