Skip to content

Instantly share code, notes, and snippets.

@maxp
Last active March 10, 2021 00:59
Show Gist options
  • Save maxp/c42f9d4afc5709b3b3c234ce8d5ae6da to your computer and use it in GitHub Desktop.
Save maxp/c42f9d4afc5709b3b3c234ce8d5ae6da to your computer and use it in GitHub Desktop.
remove nil values from map
(let [data {:a :b :c nil :d 1}]
(->> data
(remove (comp nil? second))
(into {})))
;; {:a :b, :d 1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment