This language bar is your friend. Select your favorite languages!

Idiom #13 Iterate over map keys and values

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

Illustration
#Edit dateEdit SummaryEditor
👁 Δ 59 2019-08-05, 16:38 [Cpp] Split 2 ways into 2 snippets (implementations) programming-idioms.org
👁 Δ 58 2019-08-05, 16:37 New Cpp implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 57 2019-08-02, 18:47 [Cpp] structured bindings allow you to unpack the std::pair.You shouldn't use std::endl unless you really mean to flush ... xryax
👁 Δ 56 2019-05-31, 20:57 [Dart] Update online demo MaterialTime
👁 Δ 55 2019-05-31, 20:51 [Dart] Prefer single quoted Strings as per Dart's Effective Dart guidelines at https://dart.dev/guides/language/effectiv... MaterialTime
👁 Δ 54 2019-05-31, 20:49 [Dart] Change variable `x` to `v` for "value" like `k` is "key" MaterialTime
👁 Δ 53 2017-01-17, 20:21 Restored version 51 programming-idioms.org
👁 Δ 52 2017-01-16, 20:59 [Python] a a
👁 Δ 51 2016-11-20, 18:28 [Elixir] Oops, 2 mistakes programming-idioms.org
👁 Δ 50 2016-11-14, 19:02 [Elixir] Var names k, x programming-idioms.org
👁 Δ 49 2016-11-14, 19:01 [Elixir] Var names k, x programming-idioms.org
👁 Δ 48 2016-10-18, 21:26 +keywords programming-idioms.org
👁 Δ 47 2016-10-07, 12:12 Updated picture URL by user [programming-idioms.org] programming-idioms.org
👁 Δ 46 2016-06-13, 09:40 keywords: synonyms programming-idioms.org
👁 Δ 45 2016-04-14, 15:11 [Haskell] Less confusing syntax taktoa
👁 Δ 44 2016-04-14, 15:09 [Haskell] Original version was incorrect taktoa
👁 Δ 43 2016-02-18, 17:20 Restored version 41
👁 Δ 42 2016-02-18, 16:57 [Haskell] Less duplication
👁 Δ 41 2016-02-17, 22:55 New Clojure implementation by user [pgon101a]
👁 Δ 40 2016-02-17, 17:10 [Ada] Mixed_Case_With_Underscores : MyMap -> My_Map
👁 Δ 39 2016-02-17, 16:11 [Ada] Map name is mymap
👁 Δ 38 2016-02-17, 15:40 New Ada implementation by user [Smaehtin]
👁 Δ 37 2016-02-17, 12:00 [Haskell] Less duplication
👁 Δ 36 2016-02-17, 10:57 New Csharp implementation by user [javasucks]
👁 Δ 35 2016-02-16, 21:53 New Scala implementation by user [meshelton]
👁 Δ 34 2016-02-16, 19:37 New Prolog implementation by user [Boris]
👁 Δ 33 2016-02-16, 18:28 New Cpp implementation by user [GhassanPL]
👁 Δ 32 2016-02-16, 16:58 New Lua implementation by user [jparoz]
👁 Δ 31 2016-01-05, 09:50 Linked to idiom #113 [Iterate over map entries, ordered by values]
👁 Δ 30 2016-01-05, 09:50 Linked to idiom #112 [Iterate over map entries, ordered by keys]
👁 Δ 29 2015-12-18, 02:58 New Erlang implementation by user [elbrujohalcon]
👁 Δ 28 2015-11-30, 12:37
👁 Δ 27 2015-10-29, 14:05
👁 Δ 26 2015-09-13, 12:30
👁 Δ 25 2015-09-13, 12:29
👁 Δ 24 2015-09-13, 12:22
👁 Δ 23 2015-09-13, 12:20
👁 Δ 22 2015-09-13, 12:18
👁 Δ 21 2015-09-13, 12:15
👁 Δ 20 2015-09-13, 12:15
👁 Δ 19 2015-09-13, 12:12
👁 Δ 18 2015-09-13, 12:12
👁 Δ 17 2015-09-12, 14:47
👁 Δ 16 2015-09-04, 17:32
👁 Δ 15 2015-09-04, 11:30
👁 Δ 14 2015-09-04, 11:28
👁 Δ 13 2015-08-23, 23:52
👁 Δ 12 2015-08-23, 23:52
👁 Δ 11 2015-08-21, 09:10
👁 Δ 10 2015-08-20, 18:27
👁 Δ 9 2015-08-20, 16:44
👁 Δ 8 2015-08-20, 14:29
👁 Δ 7 2015-08-20, 14:29
👁 Δ 6 2015-08-19, 14:11
👁 Δ 5 2015-08-19, 07:39
👁 Δ 4 2015-08-18, 13:37
👁 Δ 3 2015-08-01, 17:22
👁 Δ 2 2015-07-31, 19:38
1 2015-05-06, 21:04