rest op Flashcards

1
Q

Whats the diff between spread and rest ops?

A

we build with spread on the right side. Build with rest on the eft side. Spread unpacks items from arrays while rest packs items into new arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what will does const [ pizza, , risotto, . . .otherFood] =
[. . . obj.mainMenu, . . .obj.startMenu] prnt?

A

it prints the berries “pizza” and ‘risotto’ (mainMenu) and an array with all of the other items from start and main menu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly