Created
October 19, 2011 18:29
-
-
Save aruld/1299216 to your computer and use it in GitHub Desktop.
Dart forEach() on a Map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() { | |
Map<String, int> map = { | |
'one': 1, | |
'two': 2, | |
'twelve': 12}; | |
void iterateMapEntry(key, value) { | |
map[key] = value; | |
print('$key:$value');//string interpolation in action | |
} | |
map.forEach(iterateMapEntry); | |
} |
mr-muhammad-rehan
commented
Oct 29, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment