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 collection of values that never contains duplicates is a ____. | set | set | |
A collection of values that can contain duplicates is an ______. | array | array | |
Fill in the blank to create the set {1, 2, 3}. | const smallNumbers = new Set___________; | ([1, 2, 3]) | \(\[1,2,3\]\) |
Fill in the blank to create a new set containing the integers 0 and 1. | const smallNumbers = ___________; | new Set([0, 1]) | newSet\(\[0,1\]\) |
Create an empty set named popArtists. | const popArtists = new Set(); | constpopArtists=newSet\(\); | |
Create a set containing two strings. Make up the names of the set and the strings. | const flavors = new Set(["chocolate", "vanilla"]); | const[a-z_$][a-zA-Z0-9_$]*=newSet\(\[•.*•,•.*•\]\); | |
Add an integer to a set. Make up the name of the set and the integer. | scores.add(12); | [a-z_$][a-zA-Z0-9_$]*\.add\((0|-?[1-9][\d]*)\); | |
Add two integers to a set in a chain. Make up the names of the set and the integers. | someNums.add(1).add(2); | [a-z_$][a-zA-Z0-9_$]*\.add\((0|-?[1-9][\d]*)\)\.add\((0|-?[1-9][\d]*)\); | |
|
|||
|