Is the difference between them is just syntax or there's a performance issue?

Both, and more...

Rest parameters:

  1. Are a known idiom in other languages (Ruby, Python).
  2. Are easier to read and maintain (vs. slice).
  3. Are easier to understand for beginners.
  4. Can (and likely will) result in better performance, since engines can optimize.
  5. Are tool friendlier, as they can be analyzed statically.
Answer from kangax on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Functions › rest_parameters
Rest parameters - JavaScript - MDN Web Docs - Mozilla
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions in JavaScript.
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
How to Use the Spread Operator (...) In JavaScript

Thank you for sharing this. You made my day and helped me learn something really useful.

Have a nice day :)

More on reddit.com
🌐 r/webdev
5
15
May 24, 2020
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
🌐
CodeSweetly
codesweetly.com › javascript-rest-operator
Rest Operator – What Is a JavaScript Rest Parameter? | CodeSweetly
The rest operator is a syntax used to encase the rest of specific user-supplied values into a JavaScript array. It works with functions.
🌐
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
🌐
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.
🌐
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 slice() or concat(), the spread operator provides a more intuitive and readable approach to array duplication. While the spread operator expands elements, the rest operator condenses them into a single entity within function parameters or array destructuring.
🌐
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 ...
Find elsewhere
🌐
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...
🌐
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.
🌐
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.
🌐
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.
🌐
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.
🌐
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 - The rest operator in JavaScript, denoted by three dots (...), allows you to represent an indefinite number of arguments as an array within a function.
🌐
Medium
medium.com › @pallavi8khedle › difference-between-spread-and-rest-operator-dc43a86a8991
Difference between Spread and Rest operator | by Pallavikhedle | Medium
April 22, 2024 - Spread Operator(`…`): The spread ... ... Rest operator(`…`): The rest operator(…) is used in function parameters to collect all remaining arguments into an array....
🌐
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 - 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 ...
🌐
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 ... can spread them into arrays of characters: Rest parameters allow us to represent an indefinite number of arguments as an array....
🌐
DEV Community
dev.to › baroblesvi › spread-vs-rest-operators-in-javascript-45f3
Spread vs Rest Operators in JavaScript - DEV Community
March 12, 2024 - When it comes to functions, the rest is used on function definitions, while the spread operator is used when calling the function! Hope this helps! ... Flask | Streamlit | FastAPI | MLOps | Data Science | ML | Deep Learning | Reinforcement Learning | Computer Vision | SQL | Python ... Hi I am Jaswant, Junior Full Stack Developer from India, I am trying to blog things which I found fascinating or things which I faced difficult
🌐
Iqra Technology
iqratechnology.com › academy › javascript-training › js-rest-and-spread
Free JavaScript Rest and Spread Tutorial for Beginners - JS Basics
January 15, 2025 - The spread operator (…) expands elements of an array or object, while the rest operator collects multiple elements into a single array. Discover their differences in the JS rest and spread with free video tutorial.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Destructuring
Destructuring - JavaScript - MDN Web Docs
For object destructuring, it copies all enumerable own properties of the object that are not already picked off by the destructuring pattern into a new object called rest.
🌐
Dillion's Blog
dillionmegida.com › p › rest-and-spread-operator-javascript
Rest vs Spread Operator in JavaScript, Simplified - Dillion's Blog
June 14, 2020 - In this article, I'll explain what these operators do and where they can be used. The rest operator, is used to group remaining arguments in, usually in functions.