Composes multiple comparators into a single new one.
The new comparator will call them in order, if the current comparator defined the values as equal.
Nullish values in the initial array of comparators will be removed,
before creating the composed comparator.
Example
// compare by length. if equal in length, compare alphabetically constmyStringComparator = composeComparators([byLength, localeCompare]);
Composes multiple comparators into a single new one. The new comparator will call them in order, if the current comparator defined the values as equal.
Nullish values in the initial array of comparators will be removed, before creating the composed comparator.
Example