Logo

Programming-Idioms

History of Idiom 13 > diff from v49 to v50

Edit summary for version 50 by programming-idioms.org:
[Elixir] Var names k, x

Version 49

2016-11-14, 19:01:17

Version 50

2016-11-14, 19:02:09

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
for {key, value} <- mymap do
  IO.puts("#{key} => #{value}")
end
Code
for {k, x} <- mymap do
  IO.puts("#{k} => #{x}")
end
Demo URL
http://play.elixirbyexample.com/s/0e6f1f2973
Demo URL
http://play.elixirbyexample.com/s/ff27318cad