🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Functions › rest_parameters
Rest parameters - JavaScript - MDN Web Docs - Mozilla
The arguments object contains all of the parameters — including the parameters in the ...restParam array — bundled into one array-like object. In this example, the first argument is mapped to a and the second to b, so these named arguments are used as normal.
🌐
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.
Discussions

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
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
mod function
b = mod(a,m) returns the remainder after division of a by m, where a is the dividend and m is the divisor. From here https://www.mathworks.com/help/matlab/ref/mod.html More on reddit.com
🌐 r/matlab
3
2
February 25, 2023
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
🌐
Telerik
telerik.com › blogs › rest-spread-operators-explained-javascript
Rest and Spread Operators Explained in JavaScript
February 27, 2024 - From the code example above, the rest operator collects all the guests’ ages into the array guestAges.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-rest-operator
JavaScript Rest parameter - GeeksforGeeks
The rest parameter (...) allows a function to accept any number of arguments and collect them into a single array, making functions more flexible and dynamic.
Published   3 weeks ago
🌐
Geekster
geekster.in › home › rest operator in js
Rest Operator In JS With Example
June 10, 2024 - Rest Operator in JS consists of a set of three dots (.) placed together and used to capture multiple elements into one array.
🌐
Scaler
scaler.com › home › topics › what is the rest operator in javascript?
What is the rest operator in JavaScript | Scaler Topics
May 4, 2023 - The rest operator in JavaScript allows a function to take an indefinite number of arguments and bundle them in an array, thus allowing us to write functions that can accept a variable number of arguments, irrespective of the number of parameters defined.
🌐
Medium
medium.com › openwit-tech-blog › practical-applications-of-the-rest-and-spread-operators-f400856468d5
Practical Applications of the Rest and Spread Operators | OpenWit Tech Blog
October 2, 2023 - In the example above, the inviteFriends function takes the host's name as the first argument (host) and uses the rest operator (...friends) to collect any additional arguments as an array called friends.
Find elsewhere
🌐
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 (…) all
🌐
Medium
medium.com › @saravanan.softwareprogrammer › rest-operator-in-javascript-b526ec127d41
Rest Operator in JavaScript. What is Rest Operator? | by Saravanan Software Programmer | Medium
May 30, 2024 - It's called the "rest" operator because it gathers up the remaining arguments into a single array "rest" parameter. function sum(...numbers) { let result = 0; for (let number of numbers) { result += number; } return result; } console.log(sum(1, ...
🌐
Venkat Das
venkatdas.hashnode.dev › rest-operator-and-spread-operator
Rest Operator and Spread Operator - Venkat Das - Hashnode
April 27, 2023 - //arrays const players=["virat","Dhawan","Rohith","sharma"] const[virat,...restOfPlayers]=players console.log(virat, restOfPlayers) // virat [ 'Dhawan', 'Rohith', 'sharma' ] const finalResult=restOfPlayers.find((person)=>person==="sharma") console.log(finalResult) //sharma //objects const footballPlayers={ Fname:"Christiano", Lname:"Ronaldo", country:"Portuguese", club:"Al Nassr" } const{Fname,...listOfFootballPlayers}=footballPlayers console.log(Fname,listOfFootballPlayers) //functions function getAvg(Fname,...rest){ console.log(Fname) //Christiano console.log(rest) //[ 23, 23, 43, 56, 57 ] const getAvgResult= rest.reduce((total, current)=>{return total+=current},0)/rest.length console.log(getAvgResult) } getAvg(footballPlayers.Fname,23,23,43,56,57) Spread operator allows and iterable to spread or expand the items individually.
🌐
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...
🌐
Codefinity
codefinity.com › blog › Understanding-the-Spread-and-Rest-Operators-in-JavaScript
Understanding the Spread and Rest Operators in JavaScript
This article explains the spread and rest operators in JavaScript, highlighting their distinct uses for working with arrays, objects, and function parameters. It covers how the spread operator unpacks elements and the rest operator gathers elements into a single array or object.
🌐
Medium
rahultomar092.medium.com › rest-operator-in-javascript-7d82ff7053ed
Rest Operator in JavaScript. The rest operator was introduced in… | by rahul singh tomar | Medium
July 30, 2024 - in above example we can use all properties of array. function intro(name,...detail){ console.log(name)//rahul console.log(detail) // ["from" ,"gwalior"] } intro("rahul","from","gwalior"); You can see on line two, the name is being printed out, which is Rahul, and on line three detail · only contains the rest of the parameters and that’s why it’s called the rest operator.
🌐
GeeksforGeeks
geeksforgeeks.org › what-is-the-rest-parameter-and-spread-operator-in-javascript
Rest Parameter And Spread Operator in JavaScript | GeeksforGeeks
February 19, 2025 - The rest parameter collects multiple values into an array, while the spread operator spreads elements from an array or object.
🌐
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 and Spread Operator in JavaScript Rest and Spread operators use (…) three dots but are not the same. Rest Operator The operator is used to put some user-supplied values into an Array. The text …
🌐
Medium
medium.com › tulisankhusni › the-rest-operator-a-beginners-guide-in-javascript-73355a4c7c2b
The Rest Operator: A Beginner’s Guide in JavaScript | by Khusni Ja'far | Tulisan Khusni | Medium
March 3, 2023 - In the above example, we defined three arrays arr1, arr2, and arr3. We then used the Rest operator ... to concatenate the arrays into a single array arr4.
🌐
DEV Community
dev.to › ibn_abubakre › spread-vs-rest-operator-199d
Spread VS Rest Operator - DEV Community
May 6, 2020 - In the addAll function, we're are gathering all the arguments regardless of the how many, into the numbers parameter and then returning the sum. That way, we can modify the numbers parameter like we would modify a normal array. Another example of how we could use the rest operator is shown below
🌐
Medium
medium.com › @neelam.raikwar.234303 › feature-of-es6-cd8ce58c1b88
Rest Parameter or Operators. Feature of ES6 | by Neelam Raikwar | Medium
January 23, 2026 - In the above snippet, let’s assume I also want to separate 2. So, I will just do an ‘a, b, and rest’ operation and will get 1 and 2 separate, along with the rest of the numbers in the array.
🌐
Medium
medium.com › @muesingb › rest-operator-vs-spread-operator-in-functions-a68003a58aaa
Rest operator vs Spread operator in Functions | by Muesingb | Medium
April 11, 2020 - The rest operator can also be used to destructure arrays and objects. It’s called this because unlike the spread operator, it condenses rather than spreads. When you call a function with the spread operator, it references an array, and for each argument in the function it puts in place the corresponding element. In my example, I’ve called the math function using the numbers array.