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
To create a set, you use JavaScript's built-in ______. | constructor | constructor | |
Create an empty set named cities. | const cities = new Set(); | constcities=newSet\(\); | |
An array has been assigned to the variable arr. Use it to create a set named plants. | const plants = new Set(arr); | constplants=newSet\(arr\); | |
Count the number of values in a set named products and assign the number to the variable num that hasn't been declared beforehand. | let num = products.size; | letnum=products\.size; | |
Remove the integer 0 from the set named numbers. | numbers.delete(0); | numbers\.delete\(0\); | |
Remove all the values from a set named numbers. | numbers.clear(); | numbers\.clear\(\); | |
Check whether a set includes a particular string and assign the result to a variable that hasn't been declared beforehand. Make up everything. | let hasString = mammals.has("slow loris"); | let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.has\(•.*•\); | |
If a set contains more than three values, display an alert that confirms it. Make up everything. | if (mammals.size > 3) { alert("More values than 3"); } |
if\([a-z_$][a-zA-Z0-9_$]*\.size>3\){[\r\n]alert\(•.*•\);[\r\n]} | |
|
|||
|