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
The spread operator works with arrays and _____. | objects | objects | |
The spread operator copies the ______ of arrays. | elements | elements | |
Fill in the blank to include the elements of the array firstArray in the array secondArray. | const secondArray = [1, 2, 3, _______]; | ...firstArray | \.\.\.firstArray |
Fill in the blank to include the properties of the object smallTeam in the object largeTeam. | const largeTeam = { players: 10, _________ }; |
...smallTeam | \.\.\.smallTeam |
Create a new array comprising one string and all the elements of another array. Make up everything. | const pets = ["fish", ...domesticatedMammals]; | const[a-z_$][a-zA-Z0-9_$]*=\[•.*•,\.\.\.[a-z_$][a-zA-Z0-9_$]*\]; | |
In the console display the elements of an array using the spread operator. Make up the name of the array. | console.log(...planets); | console\.log\(\.\.\.[a-z_$][a-zA-Z0-9_$]*\); | |
Add the elements of an array to the end of another array. Make up the names of the arrays. | array1.push(...array2); | [a-z_$][a-zA-Z0-9_$]*\.push\(\.\.\.[a-z_$][a-zA-Z0-9_$]*\); | |
Combine the properties of two objects into a new third object. Make up everything. | const allBusRoutes = { ...expressBusRoutes, ...localBusRoutes }; |
const[a-z_$][a-zA-Z0-9_$]*={[\r\n]\.\.\.[a-z_$][a-zA-Z0-9_$]*,[\r\n]\.\.\.[a-z_$][a-zA-Z0-9_$]*[\r\n]}; | |
|
|||
|