Using the spread operator vs Using Object.assign vs BabelFastest: Using the spread operator (7.3x faster)
5,174,888 ops/sec
3,971,187 ops/sec
704,698 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Using the spread operator | |
| Using Object.assign | |
| Babel |
| Test name | Executions per second |
|---|---|
| ✓ Using Object.assign | 28,609,574 Ops/sec |
| Using the spread operator | 17,217,832 Ops/sec |
| Babel | 2,821,409 Ops/sec |