This isn't necessarily exhaustive.

Spread syntax

options = {...optionsDefault, ...options};

Advantages:

  • If authoring code for execution in environments without native support, you may be able to just compile this syntax (as opposed to using a polyfill). (With Babel, for example.)

  • Less verbose.

Disadvantages:

  • When this answer was originally written, this was a proposal, not standardized. When using proposals consider what you'd do if you write code with it now and it doesn't get standardized or changes as it moves toward standardization. This has since been standardized in ES2018.

  • Literal, not dynamic.


Object.assign()

options = Object.assign({}, optionsDefault, options);

Advantages:

  • Standardized.

  • Dynamic. Example:

    var sources = [{a: "A"}, {b: "B"}, {c: "C"}];
    options = Object.assign.apply(Object, [{}].concat(sources));
    // or
    options = Object.assign({}, ...sources);
    

Disadvantages:

  • More verbose.
  • If authoring code for execution in environments without native support you need to polyfill.

This is the commit that made me wonder.

That's not directly related to what you're asking. That code wasn't using Object.assign(), it was using user code (object-assign) that does the same thing. They appear to be compiling that code with Babel (and bundling it with Webpack), which is what I was talking about: the syntax you can just compile. They apparently preferred that to having to include object-assign as a dependency that would go into their build.

Answer from JMM on Stack Overflow
Top answer
1 of 15
432

This isn't necessarily exhaustive.

Spread syntax

options = {...optionsDefault, ...options};

Advantages:

  • If authoring code for execution in environments without native support, you may be able to just compile this syntax (as opposed to using a polyfill). (With Babel, for example.)

  • Less verbose.

Disadvantages:

  • When this answer was originally written, this was a proposal, not standardized. When using proposals consider what you'd do if you write code with it now and it doesn't get standardized or changes as it moves toward standardization. This has since been standardized in ES2018.

  • Literal, not dynamic.


Object.assign()

options = Object.assign({}, optionsDefault, options);

Advantages:

  • Standardized.

  • Dynamic. Example:

    var sources = [{a: "A"}, {b: "B"}, {c: "C"}];
    options = Object.assign.apply(Object, [{}].concat(sources));
    // or
    options = Object.assign({}, ...sources);
    

Disadvantages:

  • More verbose.
  • If authoring code for execution in environments without native support you need to polyfill.

This is the commit that made me wonder.

That's not directly related to what you're asking. That code wasn't using Object.assign(), it was using user code (object-assign) that does the same thing. They appear to be compiling that code with Babel (and bundling it with Webpack), which is what I was talking about: the syntax you can just compile. They apparently preferred that to having to include object-assign as a dependency that would go into their build.

2 of 15
353

For reference object rest/spread is finalised in ECMAScript 2018 as a stage 4. The proposal can be found here.

For the most part object assign and spread work the same way, the key difference is that spread defines properties, whilst Object.assign() sets them. This means Object.assign() triggers setters.

It's worth remembering that other than this, object rest/spread 1:1 maps to Object.assign() and acts differently to array (iterable) spread. For example, when spreading an array null values are spread. However using object spread null values are silently spread to nothing.

Array (Iterable) Spread Example

const x = [1, 2, null , 3];
const y = [...x, 4, 5];
const z = null;

console.log(y); // [1, 2, null, 3, 4, 5];
console.log([...z]); // TypeError

Object Spread Example

const x = null;
const y = {a: 1, b: 2};
const z = {...x, ...y};

console.log(z); //{a: 1, b: 2}

This is consistent with how Object.assign() would work, both silently exclude the null value with no error.

const x = null;
const y = {a: 1, b: 2};
const z = Object.assign({}, x, y);

console.log(z); //{a: 1, b: 2}
🌐
Reddit
reddit.com › r/node › [discussion] object spread much faster than object.assign(...) ?!
r/node on Reddit: [Discussion] Object spread much faster than Object.assign(...) ?!
December 26, 2021 - On node version 16, the object spread is faster than Object assign. I just tested it a simple test using performance API. I tested with different OS and node version. lodashmerge vs assign vs spread ...
Discussions

Object.Assign Vs SPREAD object
Yes const a = { b: { c: "d" } }; const a1 = Object.assign({}, a); const a2 = {...a}; a.b.c // "d" a1.b.c // "d" a2.b.c // "d" a.b.c = "f"; a.b.c // "f" a1.b.c // "f" a2.b.c // "f" More on reddit.com
🌐 r/learnjavascript
2
2
February 25, 2019
Object.assign vs Object Spread in Node.js

I've actually been wondering lately how these two measure up. Very interesting.

I ran his same tests in Node and got similar results.

HOWEVER I ran the tests in Chrome and got very different results:

First set (Object.assign directly)

Object spread x 3,032,358 ops/sec ±0.78% (54 runs sampled)
Object.assign() x 21,901,498 ops/sec ±5.47% (56 runs sampled)
Fastest is Object.assign()

Second set (Object.assign to new {})

Object spread x 2,991,669 ops/sec ±0.93% (53 runs sampled)
Object.assign() x 16,659,708 ops/sec ±1.50% (57 runs sampled)
Fastest is Object.assign()

Object.assign is still way faster than spread in Chrome. Still not a huge deal unless you're trying to optimize, but worth considering.

More on reddit.com
🌐 r/Frontend
2
40
February 5, 2019
Immer vs Object.assign()/spread operator
Never used immer, but your example only clones the root object, not any nested object references which I'm guessing immer does for you. Your state should be standalone unless designed specifically to share nested references. Example: const state = { nested: { prop: 1 } }; const newState = Object.assign({}, state); newState === state // => false newState.nested === state.nested // => true Ensuring that each state is deeply unique in dynamic and arbitrary object structures is cumbersome in vanilla ES5. More on reddit.com
🌐 r/learnjavascript
2
1
December 1, 2018
When would you use this function instead of Object.assign or the spread operator?

You wouldn't (unless you really needed to support IE and couldn't transpile with something like Babel). That site is just a little dated so you're not going to see any newer ES6+ syntax. From their homepage:

All functions work properly in IE 9 and above - most of them are compatible with IE 8. Common pitfalls are mentioned alongside concerned functions. Available plugins have no dependencies and are tested in IE 9+, some work properly in IE 8 and below.

More on reddit.com
🌐 r/learnjavascript
1
6
March 29, 2020
🌐
The Code Barbarian
thecodebarbarian.com › object-assign-vs-object-spread.html
Object.assign vs Object Spread in Node.js
January 29, 2019 - The object rest/spread operators are both syntactically neat and offer performance benefits over Object.assign(). If you're running Node.js 8 or higher, try these new operators out and make your code more concise.
🌐
Azurewebsites
benchmarklab.azurewebsites.net › Benchmarks › Show › 8719 › 0 › javascript-spread-operator-vs-objectassign-vs-new-objec
Benchmark: JavaScript spread operator vs Object.assign vs new object performance - MeasureThat.net
JavaScript spread operator vs Object.assign performance (single addition) JavaScript spread operator vs Object.assign performance - Kien Nguyen · Object.assign() vs spread operator (New object) JavaScript spread operator vs Object.assign performance test number 99 ·
🌐
MeasureThat
measurethat.net › Benchmarks › Show › 2136 › 0 › javascript-spread-operator-vs-objectassign-performance
Benchmark: JavaScript spread operator vs Object.assign performance - MeasureThat.net
Using the spread operator: 15,238,333 ops/sec · • Using Object.assign: 13,250,666 ops/sec · Results show median performance across all community submissions. Run this benchmark yourself to verify on your device. Rendered benchmark preparation results: Run tests (2) Previous results Fork ·
🌐
GitHub
gist.github.com › syaau › e9b991e55aed8c249fa5a86511f77ca5
Check spread operator vs Object.assign performance (with varying key sizes) · GitHub
Check spread operator vs Object.assign performance (with varying key sizes) - javascript-spread-operator-performance.js
🌐
MeasureThat
measurethat.net › Benchmarks › Show › 2485 › 0 › spread-vs-objectassign
Benchmark: Spread vs Object.assign - MeasureThat.net
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device. ... User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 · Browser/OS: Chrome 144 on Windows View result in a separate tab Embed ... LLMs can make mistakes. Check important info. JavaScript spread operator vs Object.assign performance with 1000 props
🌐
Pedaldrivenprogramming
pedaldrivenprogramming.com › 2020 › 08 › be-careful-with-immutability-in-javascript
Be Careful with Object.assign in Javascript
Object spread x 7,612,732 ops/sec ±1.14% (85 runs sampled)\ Object.assign() x 7,264,250 ops/sec ±1.16% (87 runs sampled)\ Mutation x 769,863,543 ops/sec ±1.50% (82 runs sampled)\ Fastest is Mutation · Again, it makes intuitive sense that using Object.assign would be slower. So is it a big deal? Probably not, as you’ll usually be using these slower, immutable patterns to work with React/Vue data in which the performance impact is not only negligible but necessary.
Find elsewhere
🌐
MeasureThat
measurethat.net › Benchmarks › Show › 16078 › 0 › javascript-spread-operator-vs-objectassign-vs-for-in-lo
Benchmark: JavaScript spread operator vs Object.assign vs for-in loop safe performance - MeasureThat.net
JavaScript spread operator vs Object.assign vs for-in loop performance · JavaScript spread operator vs Object.assign vs type-checked for-in loop performance · JavaScript spread operator vs Object.assign vs null-checked for-in loop performance · JavaScript spread operator vs Object.assign vs only-null-checked for-in loop performance ·
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › difference-between-objectassign-and-spread-operator-in-javascript
Difference Between Object.assign and Spread Operator in JavaScript - GeeksforGeeks
July 23, 2025 - While Object.assign() is useful for the merging properties into the existing object, the spread operator is more suited for creating new objects with the merged properties. Understanding the differences between these two methods will help choose ...
🌐
MeasureThat
measurethat.net › Benchmarks › Show › 9286 › 0 › objectassign-vs-spread-vs-extend
Benchmark: Object.assign vs spread vs _.extend - MeasureThat.net
✓ Object.assign: 17,026,004 ops/sec · • _.extend: 15,107,530 ops/sec · • spread operator: 11,767,460 ops/sec · Results show median performance across all community submissions. Run this benchmark yourself to verify on your device. Rendered benchmark preparation results: Run tests (3) Previous results Fork ·
🌐
Azurewebsites
benchmarklab.azurewebsites.net › Benchmarks › Show › 25996 › 0 › javascript-spread-operator-vs-objectassign-with-new-obj
Benchmark: JavaScript spread operator vs Object.assign (with new object) performance - MeasureThat.net
JavaScript spread operator vs Object.assign performance for cloning · object assign vs object spread on growing objects · JavaScript spread operator vs Object.assign performance - Kien Nguyen · Object.assign() vs spread operator (New object) JavaScript spread operator vs Object.assign performance test number 99 ·
🌐
Delicious-insights
delicious-insights.com › en › posts › js-object-spread-assign
Object spread vs. Object.assign • Delicious Insights
May 18, 2020 - Just remember that an object spread always returns a new object, of type Object, and will therefore blissfully ignore the type and writer accessors of the original object(s). Incidentally, this means that when you must alter the original object, ...
🌐
Prateek Surana
prateeksurana.me › blog › why-using-object-spread-with-reduce-bad-idea
Why using object spread with reduce probably a bad idea — Prateek Surana
Notice that when map arranges data exactly how we want, our .reduce can be just Object.assign.#typescript #javascript pic.twitter.com/3TW57kaCar— Rupert Foggo McKay (@maxfmckay) May 22, 2021 · If you see the replies, you’ll find how most people are concerned over the fact that the 2nd method is worse (which also doesn’t work as expected, as we’ll discuss later in this post) because we are iterating the array thrice when in fact the former one is much slower. After all, the spread operator takes almost O(n) time, resulting in the overall time complexity of O(n2) for the first method.
🌐
Azurewebsites
benchmarklab.azurewebsites.net › Benchmarks › Show › 19868 › 0 › structuredclone-vs-spread-vs-objectassign
Benchmark: structuredClone vs spread vs Object.assign() - MeasureThat.net
JavaScript spread operator vs Object.assign vs new object performance · object spread vs Object.assign · JavaScript spread operator vs Object.assign performance fixed 2 · JavaScript spread operator vs Object.assign performance test number 99 · Comments · Do you really want to delete benchmark?
🌐
MeasureThat
measurethat.net › Benchmarks › Show › 13876 › 0 › javascript-spread-vs-objectassign-performance-vs-native
Benchmark: JavaScript spread vs Object.assign performance vs native spread - MeasureThat.net
JavaScript spread operator vs Object.assign performance (single addition) JavaScript spread operator vs Object.assign performance - Kien Nguyen · Object.assign() vs spread operator (New object) Comments · Do you really want to delete benchmark?