max-key

functionsince v0.0-927 clojure.core/max-keyEdit
(max-key k x)
(max-key k x y)
(max-key k x y & more)

Details:

Returns the x for which (k x) is greatest.

(k x) should return a number.


See Also:


Source docstring:
Returns the x for which (k x), a number, is greatest.

If there are multiple such xs, the last one is returned.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn max-key
  ([k x] x)
  ([k x y] (if (> (k x) (k y)) x y))
  ([k x y & more]
   (reduce #(max-key k %1 %2) (max-key k x y) more)))