When using spread, you are expanding a single variable into more:

var abc = ['a', 'b', 'c'];
var def = ['d', 'e', 'f'];
var alpha = [ ...abc, ...def ];
console.log(alpha)// alpha == ['a', 'b', 'c', 'd', 'e', 'f'];
Run code snippetEdit code snippet Hide Results Copy to answer Expand

When using rest arguments, you are collapsing all remaining arguments of a function into one array:

function sum( first, ...others ) {
    for ( var i = 0; i < others.length; i++ )
        first += others[i];
    return first;
}
console.log(sum(1,2,3,4))// sum(1, 2, 3, 4) == 10;
Run code snippetEdit code snippet Hide Results Copy to answer Expand

Answer from TbWill4321 on Stack Overflow
🌐
freeCodeCamp
freecodecamp.org › news › javascript-rest-vs-spread-operators
JavaScript Rest vs Spread Operator – What’s the Difference?
September 15, 2021 - JavaScript uses three dots (...) for both the rest and spread operators. But these two operators are not the same. The main difference between rest and spread is that the rest operator puts the rest of some specific user-supplied values into a JavaSc...
🌐
Medium
medium.com › @pallavi8khedle › difference-between-spread-and-rest-operator-dc43a86a8991
Difference between Spread and Rest operator | by Pallavikhedle | Medium
April 22, 2024 - ... Mastering the Spread and Rest ... and flexible code. The spread operator is used for expanding elements, while the rest parameter is used for collecting multiple elements into an array....
Discussions

Spread Operator vs Rest Parameter
Console log is a good example of the rest one for anyone struggling to think of it. You've probably written console.log(1, 2, 3, 4) etc in the past, that is to say you can pass any number of arguments into the function and it will be ok with it More on reddit.com
🌐 r/learnjavascript
26
290
September 16, 2022
Spread Syntax vs Rest Parameter in ES2015 / ES6
You can refer this blog for rest / spread operator - tejassavaliya.medium.com/… 2020-10-29T17:26:18.03Z+00:00 ... Save this answer. ... Show activity on this post. ES6 has new feature three dots ... ... Here ...m is a collector, it collects the rest of the parameters. More on stackoverflow.com
🌐 stackoverflow.com
spread vs rest syntax in JS, a little confused.
the teacher said that the spread operator is on the right side of the "=" This seems like a really bad way of describing things. The "rest" operator appears inside of parameter lists (like in your example), or inside a destructuring declaration (like let [a, ...b] = [1, 2, 3]). It occurs where variables are being created. The "spread" operator is used when you want to "spread"/flatten the data you have into another structure. That can occur inside argument lists (some_func(...data)), or inside of something like an array ([1, 2, 3, ...someData, 4, 5, 6]). In both cases, the placement of the = is irrelevant. More on reddit.com
🌐 r/learnprogramming
4
1
July 14, 2022
spread operator (rest)
Hi rusters btw it's not "rusters", we are known as "rustaceans". More on reddit.com
🌐 r/rust
9
4
December 24, 2019
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › what-is-the-rest-parameter-and-spread-operator-in-javascript
Rest Parameter And Spread Operator in JavaScript - GeeksforGeeks
October 27, 2025 - The rest parameter collects multiple values into an array, while the spread operator spreads elements from an array or object.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Spread_syntax
Spread syntax (...) - JavaScript - MDN Web Docs - Mozilla
May 22, 2026 - Spread syntax looks exactly like rest syntax. In a way, spread syntax is the opposite of rest syntax. Spread syntax "expands" an array into its elements, while rest syntax collects multiple elements and "condenses" them into a single element. See rest parameters and rest property.
🌐
Reddit
reddit.com › r/learnjavascript › spread operator vs rest parameter
r/learnjavascript on Reddit: Spread Operator vs Rest Parameter
September 16, 2022 - So if you want to make a function that can take an indefinite or varying amount of arguments, you can do just that with the rest syntax. And then in the body of the function, you can do whatever you want with those arguments that were passed into the function, knowing that they're all contained in a single array. ... Ok, thanks. I figured out the indefinite parameters bit shortly after my post, but your explanation helps add context. ... Only array spread requires iterables.
🌐
Scaler
scaler.com › home › topics › what is the difference between spread and rest operator in javascript?
Difference Between Spread and Rest Operator in JavaScript | Scaler Topics
July 7, 2024 - Although both operators in JavaScript ... lies in their names. The spread operator in JavaScript expands values in arrays and strings into individual elements whereas, the rest operator, puts the values of user-specified data into a JavaScript array....
Find elsewhere
🌐
Codefinity
codefinity.com › blog › Understanding-the-Spread-and-Rest-Operators-in-JavaScript
Understanding the Spread and Rest Operators in JavaScript
The rest operator (...) does the opposite of the spread operator: it gathers multiple elements and consolidates them into a single array or object. This is often used in function parameters to handle variable numbers of arguments.
🌐
Telerik
telerik.com › blogs › rest-spread-operators-explained-javascript
Rest and Spread Operators Explained in JavaScript
February 27, 2024 - Well, this is where it gets tricky, but I will explain it as we proceed. A rest operator is a type of parameter that gets all of the remaining parameters of a function call via an Array.
🌐
DEV Community
dev.to › himanshudevgupta › what-is-the-difference-between-spread-and-rest-operator-in-javascript-2oa9
What is the Difference between Spread and Rest Operator in JavaScript - DEV Community
February 28, 2024 - Additionally, the Spread operator proves handy in merging properties of objects into a new object and splitting strings into individual characters. On the other hand, the Rest parameter (also denoted by ...) plays a crucial role in collecting ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › spread-vs-rest-operator-in-javascript-es6
Spread vs Rest operator in JavaScript ES6 - GeeksforGeeks
February 23, 2024 - Example: The rest operator gathers all arguments passed to the function after the first one (10 in this case) into an array called rest. ... The spread operator, represented by three dots (...), works by taking all the items in an array and ...
🌐
DEV Community
dev.to › carriepascale › javascript-s-three-dots-spread-operator-vs-rest-parameters-5agh
JavaScript's Three Dots: Spread Operator vs. Rest Parameters - DEV Community
June 5, 2020 - In both cases below, the spread ... in solving a common interview question called Max Characters. Rest parameters condense elements into an array....
🌐
Medium
medium.com › @shubham3480 › rest-and-spread-operator-in-javascript-3950e16079c8
Rest and Spread Operator in JavaScript | by Shubham Gupta | Medium
February 16, 2025 - Rest parameters are used to create functions that accept any number of arguments. The spread syntax is used to pass an array to functions that normally require a list of many arguments.
🌐
Medium
sauravkumarsharma.medium.com › rest-vs-spread-in-javascript-0b927930f8d4
Rest Vs Spread in JavaScript. JavaScript ES6 introduced two powerful… | by Saurav sharma | Medium
May 11, 2025 - This syncing does not happen with rest parameters — rest stays independent. The spread operator (...) is used to expand an iterable (like an array) into individual elements.
🌐
Medium
anujf0510.medium.com › rest-parameter-and-spread-parameter-28041dfb90eb
Spread vs Rest Parameter vs Argument object | by Anujkumar Yadav | Medium
January 11, 2022 - When ... is at the end of function parameters, it’s “rest parameters” and gathers the rest of the list of arguments into an array. When ... occurs in a function call or alike, it’s called a “spread syntax” and expands an array into a list.
🌐
Codesmith Enterprise
codesmith.io › blog › perfecting-javascripts-spread-rest-and-default-parameters
Codesmith | Perfecting JavaScript's Spread, Rest, and Default Parameters
Spread syntax can be used when ... so we can spread them into arrays of characters: Rest parameters allow us to represent an indefinite number of arguments as an array....
🌐
freeCodeCamp
freecodecamp.org › news › javascript-spread-and-rest-operators
JavaScript Spread and Rest Operators – Explained with Code Examples
February 8, 2024 - While the spread operator expands elements, the rest operator condenses them into a single entity within function parameters or array destructuring.
🌐
DEV Community
dev.to › kunal_dev › spread-vs-rest-operators-in-javascript-2m5d
Spread vs Rest Operators in JavaScript - DEV Community
April 4, 2026 - Spread is used on the right side to expand the data you already have. So You can add or update the existing Array/Object. ... Rest Operator :- Use rest when you want to collect the remaining values into an array or object.
🌐
Better Programming
betterprogramming.pub › exploring-the-spread-operator-and-rest-parameter-in-javascript-8f425b4031e2
Exploring the Spread Operator and Rest Parameter in JavaScript | by George Roubie | Better Programming
April 30, 2021 - The spread operator is an operator like +, -, /, etc. that takes an iterable (something that we can loop through) and expands it to individual elements.
🌐
freeCodeCamp
freecodecamp.org › news › spread-operator-and-rest-parameter-in-javascript-es6-4416a9f47e5e
An intro to the spread operator and rest parameter in JavaScript (ES6)
January 8, 2019 - Just as the spread operator allows you to expand an array into its individual elements, the rest parameter lets you bundle elements back into an array.