Using the spread operator vs Using Object.assign into empty objectFastest: Using the spread operator (3.0x faster)
26,995,036 ops/sec
8,964,579 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 into empty object |
| Test name | Executions per second |
|---|---|
| ✓ Using the spread operator | 20,791,154 Ops/sec |
| Using Object.assign into empty object | 8,445,812 Ops/sec |