Jun 17, 2026 · 5 min read
Rest Parameters and Spread: The Two Faces of `...` in JavaScript & TypeScript
The `...` operator does two opposite jobs depending on where you put it. In a parameter list it gathers any number of arguments into an array (rest); in a call or literal it scatters an array back into individual values (spread). Here's how to tell them apart — using a real URL-builder helper as the guide.
javascripttypescriptfunctions