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
Using the new Set() constructor, you create a set by converting an _____ to a set. | array | array | |
An array has been assigned to the variable cities. Convert it to a set. Make up the name of the set. | const setOfCities = new Set(cities); | const[a-z_$][a-zA-Z0-9_$]*=newSet\(cities\); | |
Here's an array: [1, 1, 2, 3, 4]. When converted to a set, the values will be {_______} | 1, 2, 3, 4 | 1,2,3,4 | |
Fill in the blank to convert the array to a set. | const arrayOfMammals = ________(setOfMammals); | Array.from | Array\.from |
An array's elements are 1, 2, 3. Convert the array to a set. Make up the set name. | const numsSet = new Set([1, 2, 3]); | const[a-z_$][a-zA-Z0-9_$]*=newSet\(\[1,2,3\]\); | |
Convert a set named plots to an array. Make up the name of the array. | const arrayOfPlots = Array.from(plots); | const[a-z_$][a-zA-Z0-9_$]*=Array\.from\(plots\); | |
Convert a set to an array. Make up the names. | const x = Array.from(y); | const[a-z_$][a-zA-Z0-9_$]*=Array\.from\([a-z_$][a-zA-Z0-9_$]*\); | |
The elements of an array named mammals are "loris", "tiger", "cat", "cat". Convert the array to a set whose elements are "loris", "tiger", "cat". Make up the name of the set. | const mammalSet = new Set(mammals); | const[a-z_$][a-zA-Z0-9_$]*=newSet\(mammals\); | |
|
|||
|