Functions that modify or combine existing comparators.
Basic comparison functions for ascending and descending order.
Compares values in ascending order.
Compares values in descending order.
Functions that create new comparators from selectors or transformations.
Creates a comparator that compares values by a selected key.
Composable comparison functions and combinators for sorting operations.
Provides composable comparison functions for use with Array.sort() and other comparator-based operations.
Basic Sorting
Sort arrays using ascending or descending order:
Sorting by Property
Extract and compare specific properties from objects:
Combining Multiple Criteria
Sort by multiple properties with priority order:
Handling Nullish Values
Place
nullandundefinedvalues first, before comparing others: