Juxt for custom map accessors
Let’s say we have a map like this:
(def ppl [{:name "Jeremy" :age 31 :job "programmer"}
{:name "Grace" :age 24 :job "designer"}])
If I wanted to grab just the name and age from it, I could write:
(map #(vector (get % :name) (get % :age)) ppl)
But with juxt
I can do:
(map #(juxt :name :age) ppl)
Hat tip to Tim Baldridge for this example