Skip to content

Commit 6074846

Browse files
authored
Clarify risk of duplicate keys in Map.map/2 (#11360)
1 parent 368c311 commit 6074846

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: lib/elixir/lib/map.ex

+2
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,8 @@ defmodule Map do
10441044
Maps the function `fun` over all key-value pairs in `map`, returning a map
10451045
with all the values replaced with the result of the function.
10461046
1047+
Duplicated keys are removed; the latest one prevails.
1048+
10471049
## Examples
10481050
10491051
iex> Map.map(%{1 => "joe", 2 => "mike", 3 => "robert"}, fn {_key, val} -> String.capitalize(val) end)

0 commit comments

Comments
 (0)