Creates a comparator that compares values by a selected key.
Values are ordered by a key taken from each of them, such as a property, and keys are ordered by comparator.
comparator
The type of values to compare
The type of keys to compare
Function that extracts the comparison key from a value
Comparator to apply to the extracted keys (defaults to ascending)
A comparator ordering values by their selected keys
Creates a comparator that compares values by a selected key.
Values are ordered by a key taken from each of them, such as a property, and keys are ordered by
comparator.