Logo

Programming-Idioms

History of Idiom 13 > diff from v50 to v51

Edit summary for version 51 by programming-idioms.org:
[Elixir] Oops, 2 mistakes

Version 50

2016-11-14, 19:02:09

Version 51

2016-11-20, 18:28:26

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
Extra Keywords
table dictionary hash traverse traversal
Extra Keywords
table dictionary hash traverse traversal
Code
Enum.each(mymap, fn({k, k}) ->
  IO.puts("#{k} => #{v}")
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
http://elixir-lang.org/docs/v1.0/elixir/Enum.html#each/2
Demo URL
http://play.elixirbyexample.com/s/c64ac488c1
Demo URL
http://play.elixirbyexample.com/s/c64ac488c1