
- Dart Programming Tutorial
- Dart Programming - Home
- Dart Programming - Overview
- Dart Programming - Environment
- Dart Programming - Syntax
- Dart Programming - Data Types
- Dart Programming - Variables
- Dart Programming - Operators
- Dart Programming - Loops
- Dart Programming - Decision Making
- Dart Programming - Numbers
- Dart Programming - String
- Dart Programming - Boolean
- Dart Programming - Lists
- Dart Programming - Lists
- Dart Programming - Map
- Dart Programming - Symbol
- Dart Programming - Runes
- Dart Programming - Enumeration
- Dart Programming - Functions
- Dart Programming - Interfaces
- Dart Programming - Classes
- Dart Programming - Object
- Dart Programming - Collection
- Dart Programming - Generics
- Dart Programming - Packages
- Dart Programming - Exceptions
- Dart Programming - Debugging
- Dart Programming - Typedef
- Dart Programming - Libraries
- Dart Programming - Async
- Dart Programming - Concurrency
- Dart Programming - Unit Testing
- Dart Programming - HTML DOM
- Dart Programming Useful Resources
- Dart Programming - Quick Guide
- Dart Programming - Resources
- Dart Programming - Discussion
Dart Programming - Map.forEach() Function
Applies the specified function on every Map entry. In other words, forEach enables iterating through the Maps entries.
Syntax
Map.forEach(void f(K key, V value));
Parameters
f(K key, V value) − Applies f to each key-value pair of the map.
Calling f must not add or remove keys from the map
Return Type − void.
Example
void main() { var usrMap = {"name": "Tom", 'Email': 'tom@xyz.com'}; usrMap.forEach((k,v) => print('${k}: ${v}')); }
It will produce the following output −
name: Tom Email: tom@xyz.com
dart_programming_map.htm
Advertisements