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
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