Maps

  A Map can be created by

Map<String, String> gifts = const {
'first': 'paper',
'second': 'cotton',
'third': 'leather'
}


var gifts = {
// Key: Value
'first': 'partridge',
'second': 'turtledoves',
'fifth': 'golden rings'
};


var gifts = Map();
gifts['first'] = 'partridge';
gifts['second'] = 'turtledoves';
gifts['fifth'] = 'golden rings';


var nobleGases = {
2: 'helium',
10: 'neon',
18: 'argon',
};
var nobleGases = Map();
nobleGases[2] = 'helium';
nobleGases[10] = 'neon';
nobleGases[18] = 'argon';



Comments