What is the best way to filter nil values from a Clojure map {}?
nil
{}
{ :a :x :b nil :c :z } ;;=> { :a :x, :c :z }
I use following code:
(into {} (filter val {:a 1, :b 2, :c nil})) ;;=> {:a 1, :b 2}
NOTE: this will remove false values as well as nils