Provides a function to pass to the sort or toSorted methods on arrays, which will allow those methods to sort the items by the chosen value in the chosen direction.
sort
toSorted
The type of each array item.
The type of the value to sort by.
A function that takes the item and returns the value to sort by.
The sort direction.
A function to pass into the .sort() or .toSorted() methods on arrays.
.sort()
.toSorted()
Provides a function to pass to the
sortortoSortedmethods on arrays, which will allow those methods to sort the items by the chosen value in the chosen direction.