Skip to content

Instantly share code, notes, and snippets.

@Slackwise
Last active August 29, 2015 14:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Slackwise/2ea39ae4ec465d74fb70 to your computer and use it in GitHub Desktop.
Is there a cleaner way to find an item in a collection by one of its items keys?
(def people [{:name "Adam" :age 28}
{:name "Chris" :age 25}])
(inc (:age (first (filter #(= (:name %) "Chris") people))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment