🌐
Telerik
telerik.com › blogs › rest-spread-operators-explained-javascript
Rest and Spread Operators Explained in JavaScript
February 27, 2024 - In this post, we will discuss the rest and spread operators in JavaScript, their differences, when to use them and how to apply them sequentially in our projects to create effective code.
🌐
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
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
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
Spread Love: A Look into JavaScript’s Rest and Spread Syntax

This syntax looks designed with the only purpose to break find usages mechanisms like grep.

grep \.prop *.js

{ prop, ...wtf } = obj // f you future reader

Ugh!

More on reddit.com
🌐 r/programming
3
16
August 13, 2018
🌐
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....
🌐
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....
🌐
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.
🌐
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.
🌐
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....
🌐
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.
Find elsewhere
🌐
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.
🌐
Exercism
exercism.org › tracks › javascript › concepts › rest-and-spread
Rest and Spread in JavaScript on Exercism
Depending on the context, it's called either a rest operator or spread operator. When ... appears on the left-hand side of an assignment, those three dots are known as the rest operator.
🌐
DEV Community
dev.to › theonlineaid › rest-vs-spread-in-javascript-4d7m
Rest vs spread in javascript - DEV Community
October 23, 2024 - When you use (...) in function arguments or array/object literals, it is called Spread. The Spread operator is useful for merging arrays and objects, while the Rest operator is ideal for capturing function 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.
🌐
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 - ... function example(a, b) { ... rest parameters — rest stays independent. The spread operator (...) is used to expand an iterable (like an array) into individual elements....
🌐
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....
🌐
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.
🌐
DEV Community
dev.to › pratham69 › spread-vs-rest-operators-in-javascript-59a0
Spread vs Rest Operators in JavaScript - DEV Community
May 10, 2026 - Let me break it down the way I wish someone had explained it to me. Before we look at any syntax, understand this one concept: Spread = expanding a collection into individual pieces · Rest = collecting individual pieces into a collection
🌐
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 ...
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › advanced working with functions
Rest parameters and spread syntax
October 18, 2022 - When ... occurs in a function call or alike, it’s called a “spread syntax” and expands an array into a list. ... Rest parameters are used to create functions that accept any number of arguments.
🌐
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.
🌐
BigBinary Academy
courses.bigbinaryacademy.com › learn-javascript › rest-and-spread › rest-spread-difference
Difference Between Rest & Spread - Learn JavaScript | BigBinary Academy
Rest Operator collects values into a single value. On the other hand, a spread operator expands the values of an iterable into parts.