Returns a sorted array of the values in this collection.
The comparator must be a function that accepts two values and returns a number.
A comparator for numbers should subtract the right from the left and expresses both the direction and magnitude of the difference. If the magnitude of the difference is not meaningful, a comparator should return only Infinity, -Infinity, or 0, to increase the usefulness of the comparator.
The default comparator is Object.compare
.