sort-by

functionsince v0.0-927 clojure.core/sort-byEdit
(sort-by keyfn coll)
(sort-by keyfn comp coll)

Details:

Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item).

comp can be boolean-valued comparison function, or a -/0/+ valued comparator.

comp defaults to compare.


See Also:


Source docstring:
Returns a sorted sequence of the items in coll, where the sort
order is determined by comparing (keyfn item).  Comp can be
boolean-valued comparison function, or a -/0/+ valued comparator.
Comp defaults to compare.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn sort-by
  ([keyfn coll]
   (sort-by keyfn compare coll))
  ([keyfn comp coll]
     (sort (fn [x y] ((fn->comparator comp) (keyfn x) (keyfn y))) coll)))