sortBy
SortBy is a function name used in several JavaScript utility libraries to produce a new array sorted according to one or more computed keys rather than the elements themselves. The most common implementations come from libraries such as Lodash and Underscore. It does not modify the input collection; instead it returns a new, sorted array.
In typical usage, sortBy takes a collection (array or array-like) and one or more iteratees that specify
Common examples (in a Lodash-like style): sortBy(users, 'age') sorts by age in ascending order; sortBy(items, [getPriority,
A note: sortBy usually returns a new array and does not mutate the original one. The exact