update-vals

functionsince v1.11.50Edit
(update-vals m f)

Source docstring:
m f => {k (f v) ...}
Given a map m and a function f of 1-argument, returns a new map where the keys of m
are mapped to result of applying f to the corresponding values of m.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn update-vals
  {:added "1.11"}
  [m f]
  (with-meta
    (persistent!
      (reduce-kv (fn [acc k v] (assoc! acc k (f v)))
                 (if (implements? IEditableCollection m)
                   (transient m)
                   (transient {}))
                 m))
    (meta m)))