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
A map is a collection of ___-value pairs. | key | key | |
You create a map by using a built-in ________. | constructor | constructor | |
Create an empty map named species. | const species = new Map(); | constspecies=newMap\(\); | |
When intantiating a map, you assign key-value pairs using an array of ______. | arrays | arrays | |
Assign a string key and integer value to a map that has already been declared. Make up the map name, string, and integer. | playersOnField.set("football", 11); | [a-z_$][a-zA-Z0-9_$]*\.set\(•.*•,(0|-?[1-9][\d]*)\); | |
Chain two key-value assignments. The keys are strings; the values are integers. Make up the map name, strings, and integers. | playersOnField.set("football", 11).set("baseball", 9); | [a-z_$][a-zA-Z0-9_$]*\.set\(•.*•,(0|-?[1-9][\d]*)\)\.set\(•.*•,(0|-?[1-9][\d]*)\); | |
Fill in the blank to assign a second key-value pair. Make up the string key and the integer value | const playersOnField = new Map([ ["football", 11], ___________ ]); |
["baseball", 9] | \[•.*•,(0|-?[1-9][\d]*)\] |
Intantiate a map that has a single key-value pair. The key is a string. The value is an integer. Make up everything. | const playersOnField = new Map([ ["football", 11] ]); |
const[a-z_$][a-zA-Z0-9_$]*=newMap\(\[[\r\n]\[•.*•,(0|-?[1-9][\d]*)\][\r\n]\]\); | |
|
|||
|