๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ javascript-spread-and-rest-operators
JavaScript Spread and Rest Operators โ€“ Explained with Code Examples
February 8, 2024 - Unlike traditional methods like ... array duplication. While the spread operator expands elements, the rest operator condenses them into a single entity within function parameters or array destructuring....
๐ŸŒ
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 - JavaScript introduced the Rest Parameter and Spread Operator in ES6 to make handling functions and arrays more flexible and concise. These operators use the same syntax (...), but they serve different purposes.
Discussions

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
What is the difference between the rest and spread operator?
I think its very confusing More on reddit.com
๐ŸŒ r/learnjavascript
3
7
September 16, 2021
Rest and Spread operator: Three dots that changed JavaScript

I wouldn't recommend naming the function parameter of a reduce previous.

function sum(...args) {
return args.reduce((previous, current)=> {
return previous + current;
});
}

The first parameter is the accumulator. total or previousTotal or anything that suggests that we're building on it may be better.

previous suggests that we're comparing to the previous item in the array, and examples that use it can make reduce functions even more complicated to understand than they need to be.

More on reddit.com
๐ŸŒ r/learnjavascript
4
98
August 18, 2020
C# 12 spread operator in practice
I'm convinced this is a feature I'm going to see in Reddit threads by confused newbies 99.9999% more than in discussions of solutions to a problem. More on reddit.com
๐ŸŒ r/csharp
20
50
January 10, 2024
๐ŸŒ
Codefinity
codefinity.com โ€บ blog โ€บ Understanding-the-Spread-and-Rest-Operators-in-JavaScript
Understanding the Spread and Rest Operators in JavaScript
While they share the same syntax, it's essential to understand their different use cases: the spread operator is used to unpack elements, while the rest operator gathers elements together.
๐ŸŒ
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 - In an object literal, the spread ... 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....
๐ŸŒ
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 operators in JavaScript is essential for writing clean, efficient, and flexible code. The spread operator is used for expanding elements, while the rest parameter is used for collecting multiple elements into an array.
๐ŸŒ
Medium
medium.com โ€บ @anton.martyniuk โ€บ spread-and-rest-operators-in-javascript-a5d1f1ee60dd
Spread and Rest Operators in JavaScript | by Anton Martyniuk | Medium
March 21, 2024 - While the spread operator expands an array or object into its individual elements, the rest operator does the opposite, collecting multiple elements or properties into a single array or object.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ javascript-rest-vs-spread-operators
JavaScript Rest vs Spread Operator โ€“ Whatโ€™s the Difference?
September 15, 2021 - 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 JavaScript array.
๐ŸŒ
Telerik
telerik.com โ€บ blogs โ€บ rest-spread-operators-explained-javascript
Rest and Spread Operators Explained in JavaScript
February 27, 2024 - The rest and spread operators are two of the advanced features introduced in ES6, allowing us to spread out and mix several elements. These two operators havenโ€™t received as much attention in recent development, yet they play a significant role in writing clean and efficient code.
Find elsewhere
๐ŸŒ
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....
๐ŸŒ
DEV Community
dev.to โ€บ baroblesvi โ€บ spread-vs-rest-operators-in-javascript-45f3
Spread vs Rest Operators in JavaScript - DEV Community
March 12, 2024 - ... Thank you for your comment! Actually, I meant for destructuring! When it comes to functions, the rest is used on function definitions, while the spread operator is used when calling the function!
๐ŸŒ
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.
๐ŸŒ
Anton Dev Tips
antondevtips.com โ€บ blog โ€บ spread-and-rest-operators-in-javascript
Spread and Rest Operators in JavaScript
While the spread operator expands an array or object into its individual elements, the rest operator does the opposite, collecting multiple elements or properties into a single array or object.
๐ŸŒ
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 - In JavaScript, the Spread and Rest operators are essential tools that enhance the flexibility and functionality of code. The Spread operator (denoted by ...) is primarily used to expand iterables, such as arrays or strings, into individual elements.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ spread-vs-rest-operator-in-javascript-es6
Spread vs Rest operator in JavaScript ES6 - GeeksforGeeks
February 23, 2024 - ... The spread operator, represented by three dots (...), works by taking all the items in an array and spreading them out, essentially unpacking the array so that each item becomes an individual element.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ rest-and-spread-operators-in-javascript
Rest and Spread operators in JavaScript
July 15, 2020 - The rest operator (โ€ฆ) allows us to call a function with any number of arguments and then access those excess arguments as an array. The rest operator also allows us in destructuring array or objects. The spread operator (โ€ฆ) allows us to expand an iterable like array into its individual elements.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnprogramming โ€บ spread vs rest syntax in js, a little confused.
r/learnprogramming on Reddit: spread vs rest syntax in JS, a little confused.
July 14, 2022 -

Hi all,

I'm currently having some issues learning the spread vs rest operator in JS. In the beginning of the lecture, the teacher said that the spread operator is on the right side of the "=" whereas the rest operator is on the left side of the "=". I thought I had understood it as it made sense with the problems that was presented. Then towards the end of the lecture when he used it as a function, he was able to use the rest operator on the RIGHT side of the function. Why is that?

const add = function (...numbers) {
  let sum = 0;
  for (let i = 0; i < numbers.length; i++) sum += numbers[i];
  console.log(numbers);
};

add(2, 3);

Shouldn't this then be a spread operation instead of a rest operation since the ... is on the right side of the =? Or is it because when the function gets called, since the input is individual numbers, it will automatically do the opposite of what it currently is? like since its already individual numbers, the ... essentially will use it as a rest operator whereas if maybe I put in an array then it will understand to use it as a spread operator?

please ELI5, the more I look at it the more I confuse myself

thanks

๐ŸŒ
DEV Community
dev.to โ€บ rajusaha โ€บ demystifying-the-ellipsis-spread-operator-vs-rest-operator-in-javascript-25gj
Demystifying the Ellipsis (...): Spread Operator vs Rest Operator in JavaScript - DEV Community
July 3, 2024 - Use Spread to unpack iterables and distribute elements, while Rest gathers the remaining elements into a single array. Remember, the Spread Operator can also be used to spread object properties when creating new objects or merging existing ones.
๐ŸŒ
Exercism
exercism.org โ€บ tracks โ€บ javascript โ€บ concepts โ€บ rest-and-spread
Rest and Spread in JavaScript on Exercism
It allows the function to accept ... 'two', 'three'); // => 'one two three' When ... appears on the right-hand side of an assignment, it's known as the spread operator....
๐ŸŒ
DEV Community
dev.to โ€บ antonmartyniuk โ€บ spread-and-rest-operators-in-javascript-50eg
Spread and Rest Operators in JavaScript - DEV Community
April 21, 2024 - While the spread operator expands an array or object into its individual elements, the rest operator does the opposite, collecting multiple elements or properties into a single array or object.