Using the spread operator vs Using Object.assignFastest: Using the spread operator (3.7x faster)
21,611,484 ops/sec
5,866,378 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 |
| Test name | Executions per second |
|---|---|
| ✓ Using Object.assign | 26,247,028 Ops/sec |
| Using the spread operator | 18,068,720 Ops/sec |