Maps
// a map is an object that associates keys and values var person = Map<String, String>(); // To initialize the map, do this: person['firstName'] = 'Nicola'; person['lastName'] = 'Tesla'; print(person); //Print: {firstName: Nicola, lastName: Tesla} print(person['lastName']); //Print: Tesla var nobleGases = { // Key: Value 2: 'helium', 10: 'neon', 18: 'argon', };
Comments