Skip to content

Commit

Permalink
Mention syntax for updating multiple map keys (#14041)
Browse files Browse the repository at this point in the history
  • Loading branch information
leifmetcalf authored Dec 9, 2024
1 parent 9753a10 commit 3f01b31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/elixir/lib/map.ex
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ defmodule Map do
iex> %{map | one: "one"}
%{one: "one", two: 2}
Or any other key:
Or any other keys:
iex> other_map = %{"three" => 3, "four" => 4}
iex> %{other_map | "three" => "three"}
%{"four" => 4, "three" => "three"}
iex> other_map = %{"three" => 3, "four" => 4, "five" => 5}
iex> %{other_map | "three" => "three", "four" => "four"}
%{"five" => 5, "four" => "four", "three" => "three"}
When a key that does not exist in the map is updated a `KeyError` exception will be raised:
Expand Down

0 comments on commit 3f01b31

Please sign in to comment.