🌐
W3Schools
w3schools.com › react › react_es6_spread.asp
React ES6 Spread Operator
React Compiler React Quiz React Exercises React Syllabus React Study Plan React Server React Interview Prep React Bootcamp ... The JavaScript spread operator (...) copies all or part of an existing array or object into another 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 - The spread (...) syntax allows an iterable, such as an array or string, to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected. In an object literal, the spread syntax enumerates the properties of an object and adds the key-value ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › es6-spread-operator
ES6 Spread Operator - GeeksforGeeks
April 14, 2023 - But the spread operator does not make changes in the original array it also does operations in the spread operator. ... Example 1: Here we have copied the array (from cars1 to cars2 and cars1 to cars3 ) by using the spread operator.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-spread-operator
JavaScript Spread Operator - GeeksforGeeks
The spread operator (...) with objects is used to create copies of existing objects with new or updated values or to make a copy of an object with more properties. Let's take an example of how to use the spread operator on an object,
Published   January 16, 2026
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript array methods › javascript spread operator
The Practical Usages of JavaScript Spread Operator
May 8, 2024 - In this example, the three dots ( ...) located in front of the odd array is the spread operator. The spread operator (...) unpacks the elements of the odd array. Note that ES6 also has the three dots ( ...) which is a rest parameter that collects ...
🌐
Kinsta®
kinsta.com › home › resource center › blog › javascript tutorials › unleashing the power of javascript spread operator
Unleashing the Power of JavaScript Spread Operator - Kinsta®
October 1, 2025 - The spread operator in JavaScript is a syntax introduced in ECMAScript 6 (ES6) that allows you to spread the elements of an iterable (such as arrays, strings, or objects), into another iterable or function call.
🌐
Medium
eleftheriabatsou.medium.com › javascript-spread-operator-explained-with-examples-a38caf568ffd
JavaScript Spread Operator Explained (with Examples) | by Eleftheria Batsou | Medium
September 30, 2024 - JavaScript Spread Operator Explained (with Examples) Introduction The JavaScript spread operator (...) is one of the most powerful features introduced in ES6. At first glance, the three dots might …
🌐
DigitalOcean
digitalocean.com › community › tutorials › js-spread-operator
What's the Spread Operator Used For in JavaScript? | DigitalOcean
July 11, 2022 - An “iterable object” is anything you can iterate over item by item, such as arrays, objects literals, and strings. These kinds of JavaScript types can be traversed in some sequential fashion. For example, you can use a for loop on an array, or with JavaScript objects, you can use for...in loops.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › explain-spread-operator-in-es6-with-an-example
Explain spread operator in ES6 with an Example - GeeksforGeeks
July 23, 2025 - That is, it basically spreads out all the elements of an array, and further after spreading the array elements we could perform any operations with those elements like concatenation, copying the elements of an array into another array, and so on.
Find elsewhere
🌐
DEV Community
dev.to › hkp22 › javascript-spread-operator-advanced-techniques-and-best-practices-5cbn
JavaScript Spread Operator: Advanced Techniques and Best Practices - DEV Community
June 5, 2024 - // Example with arrays const numbers = [1, 2, 3]; const moreNumbers = [...numbers, 4, 5, 6]; console.log(moreNumbers); // Output: [1, 2, 3, 4, 5, 6] // Example with objects const person = { name: 'Alice', age: 25 }; const updatedPerson = { ...
🌐
Stack Abuse
stackabuse.com › spread-operator-in-javascript
Spread Operator in JavaScript
August 24, 2023 - Both the Spread Operator and Rest Parameter share the same syntax i.e. the three magical dots .... But they behave exactly opposite to each other. As a beginner, sometimes this may be confusing. The bottom-line to understand the behavior is to understand the context in which it is being used. As we learned, the spread operator expands the contents of an iterable.
🌐
W3Schools
w3schools.com › howto › howto_js_spread_operator.asp
How To Use the Spread Operator (...) in JavaScript
The JavaScript spread operator (...) expands an iterable (like an array) into more elements.
🌐
Programiz
programiz.com › javascript › spread-operator
JavaScript Spread Operator
The JavaScript spread operator ... is used to expand or spread out elements of an iterable, such as an array, string, or object. This makes it incredibly useful for tasks like combining arrays, passing elements to functions as separate arguments, or even copying arrays.
🌐
Medium
medium.com › swlh › the-es6-spread-operator-7277979ebbc8
The JavaScript ES6 {…spread} operator | by Vishal Raj | The Startup | Medium
June 6, 2020 - Lets see the examples; I will begin with passing argument. const args = [1, [2], “Vishal Raj”, { city: “Dubai”, country: “UAE”}]; parseData(…args); // This will pass 4 arguments to function parseData in the same order as the element ...
🌐
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 - Before ES6, you might use the concat method: var fruits = ["apple", "orange"]; var moreFruits = ["cherry", "lemon"]; var allFruits = fruits.concat(moreFruits); With the spread operator, this becomes much more intuitive and concise: var fruits = ["apple", "orange"]; var moreFruits = ["cherry", "lemon"]; const allFruits = [...fruits, ...moreFruits]; ...
🌐
Medium
medium.com › @premnathm › spread-and-rest-operators-in-javascript-es6-23e5506dacb1
Spread and Rest Operators in JavaScript (ES6) | by Premnath M | Medium
April 12, 2025 - // Quick Recap Example const numbers = [1, 2, 3, 4]; const [first, …rest] = numbers; // Rest in destructuring const updatedNumbers = […rest, 5]; // Spread to expand and add console.log(first); // Output: 1 console.log(rest); // Output: [2, ...
🌐
HTML Goodies
htmlgoodies.com › home › javascript
The Revolutionary ES6 Rest and Spread Operators | HTML Goodies
August 23, 2022 - This tutorial provided an overview of the enigmatic ES6 Rest and Spread operators and outlined when to use one versus the other. The key is to remember that each achieves the almost opposite result of the other: the Rest parameter collects all the remaining function arguments into an array, while the Spread operator expands iterables into individual elements. Read more JavaScript programming and web development tutorials.
🌐
Medium
medium.com › @mojahidulislamt17 › es6-in-javascript-spread-operator-destructuring-and-more-693b7c0b5a7a
ES6 in JavaScript: Spread Operator, Destructuring, and More | by Mojahidul Islam | Medium
August 5, 2025 - These ES6 features not only make your code shorter but also cleaner, more efficient, and easier to read. Whether you’re copying arrays with the spread operator, pulling values out with destructuring, or transforming arrays using map, filter, and reduce, these tools are essential for every modern JavaScript developer.
🌐
CodinGame
codingame.com › playgrounds › 7998 › es6-tutorials-spread-operator-with-fun
ES6 Tutorials : SPREAD Operator with Fun
CodinGame is a challenge-based training platform for programmers where you can play with the hottest programming topics. Solve games, code AI bots, learn from your peers, have fun.
Top answer
1 of 7
30
  1. In your example given, there is essentially no difference between the two
  2. .concat is significantly more efficient: http://jsperf.com/spread-into-array-vs-concat because ... (spread) is merely syntax sugar on top of more fundamental underlying syntax that explicitly iterates over indexes to expand the array.
  3. Spread allows sugared syntax on top of more clunky direct array manipulation

To expand on #3 above, your use of spread is a somewhat contrived example (albeit one that will likely appear in the wild frequently). Spread is useful when - for example - the entirety of an arguments list should be passed to .call in the function body.

function myFunc(){
    otherFunc.call( myObj, ...args );
}

versus

function myFunc(){
    otherFunc.call( myObj, args[0], args[1], args[2], args[3], args[4] );
}

This is another arbitrary example, but it's a little clearer why the spread operator will be nice to use in some otherwise verbose and clunky situations.

As @loganfsmyth points out:

Spread also works on arbitrary iterable objects which means it not only works on Arrays but also Map and Set among others.

This is a great point, and adds to the idea that - while not impossible to achieve in ES5 - the functionality introduced in the spread operator is one of the more useful items in the new syntax.


For the actual underlying syntax for the spread operator in this particular context (since ... can also be a "rest" parameter), see the specification. "more fundamental underlying syntax that explicitly iterates over indexes to expand the array" as I wrote above is enough to get the point across, but the actual definition uses GetValue and GetIterator for the variable that follows.

2 of 7
8

Taking the questions out of order, let's start with the fundamental question: What exactly is the use of spread syntax?

Spread syntax basically unpacks the elements of an iterable such as an array or object. Or, for the more detailed explanation from the MDN Web Docs on spread syntax:

Spread syntax allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.

Following are some simple examples of typical use cases for spread syntax and an example of the difference between spread syntax and rest parameters (they may look the same, but they perform nearly opposite functions).

Function call:

const multiArgs = (one, two) => {
  console.log(one, two);
};

const args = [1, 2];
multiArgs(...args);
// 1 2
Run code snippetEdit code snippet Hide Results Copy to answer Expand

Array or string literal:

const arr1 = [2, 3];
const arr2 = [1, ...arr1, 4];
console.log(arr2);
// [1, 2, 3, 4]

const s = 'split';
console.log(...s);
// s p l i t
Run code snippetEdit code snippet Hide Results Copy to answer Expand

Object literal:

const obj1 = { 1: 'one' };
const obj2 = { 2: 'two' };
const obj3 = { ...obj1, ...obj2 };
console.log(obj3);
// { 1: 'one', 2: 'two' }
Run code snippetEdit code snippet Hide Results Copy to answer Expand

Rest parameter syntax is not the same as spread syntax:

Rest parameter syntax looks the same as spread syntax but actually represents an unknown number of function arguments as an array. So rather than "unpacking" the iterable, rest parameters actually package multiple arguments into an array.

const multiArgs = (...args) => {
  console.log(args);
};

multiArgs('a', 'b', 'c');
// ['a', 'b', 'c']
Run code snippetEdit code snippet Hide Results Copy to answer Expand

Spread syntax performance / efficiency:

To address the question about efficiency compared to other methods, the only honest answer is that "it depends". Browsers change all the time and the context and data associated with a particular function create wildly different performance outcomes, so you can find all sorts of conflicting performance timings that suggest spread syntax is both amazingly faster and ridiculously slower than various array or object methods you might use to accomplish similar objectives. In the end, any situation where optimizations for speed are critical should be comparison tested rather than relying on generic timings of simplistic functions that ignore the specifics of your code and data.

Comparison to concat():

And finally a quick comment regarding the difference between spread syntax and concat() shown in the question code. The difference is that spread syntax can be used for a lot more than just concatenating arrays, but concat() works in older browsers like IE. In a situation where you are not concerned about compatibility with older browsers and micro optimizations for speed are unnecessary, then the choice between spread syntax and concat() is just a matter of what you find more readable: arr3 = arr1.concat(arr2) or arr3 = [...arr1, ...arr2].