This is the final post in our JavaScript series on destructuring. Let’s focus on the rest operator, which materializes with three little dots ...
as follows:
One way to put it is that the rest operator means “everything else goes into a new array.”
This syntax also works with objects, with the “rest of the properties going into a new object”:
The rest operator can also be used in a function to catch several parameters in an array: