Using the spread operator vs Using Object.assign vs New objectFastest: New object (3.7x faster)
180,344,576 ops/sec
71,887,344 ops/sec
49,213,052 ops/sec
Fastest: New object (126.9x faster)
1,934,041,472 ops/sec
24,622,372 ops/sec
15,235,266 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 | |
| New object |
| Test name | Executions per second |
|---|---|
| ✓ New object | 1,794,699,008 Ops/sec |
| Using Object.assign | 24,439,644 Ops/sec |
| Using the spread operator | 15,959,771 Ops/sec |