Creates a comparator that compares values by a selected key.
Extracts a comparable key from each value using the selector function, then applies the specified comparator to the keys.
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 function that compares values by their selected keys
Creates a comparator that compares values by a selected key.
Extracts a comparable key from each value using the selector function, then applies the specified comparator to the keys.