Use the '...' syntax to expand iterables and collect arguments.
The spread (`...`) and rest (`...`) operators use the same three-dot syntax but perform opposite functions depending on the context. The spread operator is used to *expand* an iterable (like an array or string) into its individual elements. It's commonly used to create a shallow copy of an array, to merge two or more arrays into a new one, or to pass the elements of an array as individual arguments to a function. For objects, the spread operator can be used to create copies and merge objects, with properties from later objects overwriting earlier ones. The rest operator, on the other hand, is used to *collect* multiple elements into a single array. You've seen it with function parameters (rest parameters), where it gathers an indefinite number of arguments into an array. It's also used in destructuring assignments. When destructuring an array, the rest operator can be used on the last variable to collect all remaining elements of the array into a new array. Understanding the context is key: if `...` is used where values are expected (like in an array literal or function call), it's spreading. If it's used where variable names are declared (like in a function parameter list or a destructuring assignment), it's resting.