Suppose you have an array of marketplace prices and want the lowest one. `Math.min` expects separate arguments, not one array. Put `...` before the array to pass its values individually. This is spread: it ungroups an iterable where its items are needed. section 23.3
const prices = // get array of prices const lowestPrice = Math.min(...prices);
Here, `Math.min(...prices)` receives each price as a separate argument. section 23.3
Spread works with iterables, not just arrays. Spreading a string supplies its characters one by one. Arrays, strings, Sets, and Maps share the iterable protocol; the same syntax can therefore use their produced values. section 23.3 section 23.1
Build an array from individual values
`[...'123', 'ABC']` produces `['1', '2', '3', 'ABC']`. Spread adds the string’s three characters separately; the unspread `'ABC'` remains one array item. Likewise, `[...cart, item]` makes an array containing the cart’s existing items followed by the new item. section 23.3
The same `...` syntax can run in the opposite direction. In a function definition, rest gathers separate arguments into an array: `function findDuplicates(...values)`. At a call site, spread ungroups an existing array: `findDuplicates(...letters)`. Passing `letters` without spread would supply one array argument instead of its individual letters. section 23.3
Spread also offers a concise way to make an array for code that needs to modify a copy: `const copy = [...items]`. Try predicting the lengths of `[...'123']`, `[...['123']]`, and `[...[1, 2, 3]]`. One limit matters: spreading an infinite iterable never finishes requesting values, so take a finite number of values from it instead. section 23.3 section 23.5


