Initial commit
This commit is contained in:
37
test/aggregation/map.dart
Normal file
37
test/aggregation/map.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
void main() {
|
||||
foo3();
|
||||
}
|
||||
|
||||
void foo1() {
|
||||
Map<int, String> numMap = {
|
||||
0: 'zero',
|
||||
1: 'one',
|
||||
2: 'two',
|
||||
};
|
||||
print(numMap);
|
||||
numMap.remove(1);
|
||||
print(numMap);
|
||||
}
|
||||
|
||||
void foo2() {
|
||||
Map<int, String> numMap = {
|
||||
0: 'zero',
|
||||
1: 'one',
|
||||
2: 'two',
|
||||
};
|
||||
numMap[3] = 'three';
|
||||
numMap[4] = 'four';
|
||||
print(numMap);
|
||||
}
|
||||
|
||||
void foo3() {
|
||||
Map<int, String> numMap = {
|
||||
0: 'zero',
|
||||
1: 'one',
|
||||
2: 'two',
|
||||
};
|
||||
numMap.forEach((key, value) {
|
||||
print("${key} = $value");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user