Skip to content

Call out what happens to duplicate keys in Map.map/2 in the docs #11360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/elixir/lib/map.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,8 @@ defmodule Map do
Maps the function `fun` over all key-value pairs in `map`, returning a map
with all the values replaced with the result of the function.

Duplicated keys are removed; the latest one prevails.

## Examples

iex> Map.map(%{1 => "joe", 2 => "mike", 3 => "robert"}, fn {_key, val} -> String.capitalize(val) end)
Expand Down