{"version":"1.0","type":"rich","title":"filter maps in elixir","description":"This example demonstrates two different approaches to filtering maps in Elixir. It shows how to remove entries with falsy values from a map using `Enum.reduce` and `Map.put`, building a new map that only contains truthy key-value pairs. It then contrasts this with `Enum.filter`, which returns a list of tuples rather than a map, and accesses the result with bracket notation like `result[:val]`. The code defines an input map with mixed values (`:result`, `:description`, `:val`) and inspects both outputs, highlighting the behavioral difference between reducing into a map and filtering into a list.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-c1338de556f9e95aba8f?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}