Map Flashcards
1
Q
Definition
A
Key:Value pairs like python Dictionary
2
Q
Create
A
var myMap = {“Name”:”John”, “Class”:”300”};
print(myMap); #print all elements
print(myMap[“Key”]; #print a specific value
3
Q
Displaying
A
print(myMap.values);
print(myMap.keys);
print(myMap.length);
4
Q
Add Elements
A
myMap[“Key”] = “Value”;
myMap.addAll({key: value, key:value});
5
Q
Remove Elements
A
myMap.remove(“Key”);
myMap.clear();