Logo

Programming-Idioms

History of Idiom 13 > diff from v53 to v54

Edit summary for version 54 by MaterialTime:
[Dart] Change variable `x` to `v` for "value" like `k` is "key"

Version 53

2017-01-17, 20:21:51

Version 54

2019-05-31, 20:49:45

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
mymap.forEach((k, x) => print("Key=$k, Value=$x"));
Code
mymap.forEach((k, v) => print("Key=$k, Value=$v"));
Demo URL
https://dartpad.dartlang.org/8a25c9342ce62745f0f3
Demo URL
https://dartpad.dartlang.org/8a25c9342ce62745f0f3