Last active
March 10, 2021 00:59
-
-
Save maxp/c42f9d4afc5709b3b3c234ce8d5ae6da to your computer and use it in GitHub Desktop.
remove nil values from map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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