Skip to content

Commit 3f01b31

Browse files
authored
Mention syntax for updating multiple map keys (#14041)
1 parent 9753a10 commit 3f01b31

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/elixir/lib/map.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ defmodule Map do
9696
iex> %{map | one: "one"}
9797
%{one: "one", two: 2}
9898
99-
Or any other key:
99+
Or any other keys:
100100
101-
iex> other_map = %{"three" => 3, "four" => 4}
102-
iex> %{other_map | "three" => "three"}
103-
%{"four" => 4, "three" => "three"}
101+
iex> other_map = %{"three" => 3, "four" => 4, "five" => 5}
102+
iex> %{other_map | "three" => "three", "four" => "four"}
103+
%{"five" => 5, "four" => "four", "three" => "three"}
104104
105105
When a key that does not exist in the map is updated a `KeyError` exception will be raised:
106106

0 commit comments

Comments
 (0)