Skip to content

Instantly share code, notes, and snippets.

@w33tmaricich
Last active March 21, 2016 14:08
Show Gist options
  • Save w33tmaricich/732b76e9a6dcd741d69c to your computer and use it in GitHub Desktop.
Save w33tmaricich/732b76e9a6dcd741d69c to your computer and use it in GitHub Desktop.
clj: retrieves the first key that has the associated value
(defn key-with-value¬
"Retrieves the first key that has the associated value"
[list-items value]
(first (filter (comp #{value} list-items) (keys list-items))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment