Using the spread operator vs Using Object.assignFastest: Using the spread operator (1.3x faster)
39,223,236 ops/sec
29,553,288 ops/sec
Fastest: Using Object.assign (1.6x faster)
26,826,592 ops/sec
16,823,466 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 | 16,366,805 Ops/sec |
| Using the spread operator | 10,608,447 Ops/sec |