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