Map.put_new
You're seeing just the function
put_new
, go back to Map module for more information.
Specs
Puts the given value
under key
unless the entry key
already exists in map
.
Examples
iex> Map.put_new(%{a: 1}, :b, 2)
%{a: 1, b: 2}
iex> Map.put_new(%{a: 1, b: 2}, :a, 3)
%{a: 1, b: 2}