1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
Any data type can be used as a key in ____. | maps | maps | |
Assign a value to a map's key. The key is a string. The value is an integer. Make up everything. | iron.set("atomic number", 26); | [a-z_$][a-zA-Z0-9_$]*\.set\(•.*•,(0|-?[1-9][\d]*)\); | |
Fill in the blank to assign the key and value to the map. | pakistanMap.___("population", 221000000); | set | set |
Fill in the blank to assign the value to the variable. | let pakPop = pakistanMap.___"population"); | get | get |
Get a count of the key-value pairs in a map and assign it to a variable that hasn't been declared beforehand. Make up everything. | let count = species.size; | let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.size; | |
Remove a key-value pair from a map. The key is a string. Make up everything. | species.delete("range"); | [a-z_$][a-zA-Z0-9_$]*\.delete\(•.*•\); | |
Remove all the key-value pairs from a map. Make up the name of the map. | species.clear(); | [a-z_$][a-zA-Z0-9_$]*\.clear\(\); | |
Check whether a map contains a particular key-value pair and assign the result to a variable that hasn't been declared beforehand. The key is an integer. Make up everything. | let itsThere = species.has(12); | let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.has\((0|-?[1-9][\d]*)\); | |
|
|||
|