Logo

Programming-Idioms

History of Idiom 13 > diff from v79 to v80

Edit summary for version 80 by programming-idioms.org:
[Elixir] 404

Version 79

2020-04-29, 09:42:30

Version 80

2020-05-10, 21:44:02

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Illustration

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Illustration
Variables
k,x,mymap
Extra Keywords
table dictionary hash traverse traversal
Extra Keywords
table dictionary hash traverse traversal
Code
Enum.each(mymap, fn({k, x}) ->
  IO.puts("#{k} => #{x}")
end)
Code
Enum.each(mymap, fn({k, x}) ->
  IO.puts("#{k} => #{x}")
end)
Doc URL
http://elixir-lang.org/docs/v1.0/elixir/Enum.html#each/2
Doc URL
https://hexdocs.pm/elixir/Enum.html#each/2