Map.put_new(my_map, :key, value)
will only put the key/value if the key does not exist in the map.
5 Likes
Map.put_new(my_map, :key, value)
will only put the key/value if the key does not exist in the map.