With Object.assign() vs With Iteration and Assignment vs With Iteration and .keys().forEachFastest: With Iteration and Assignment (1.8x faster)
4,197,512 ops/sec
3,510,346 ops/sec
2,275,095 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| With Object.assign() | |
| With Iteration and Assignment | |
| With Iteration and .keys().forEach |
| Test name | Executions per second |
|---|---|
| ✓ With Iteration and .keys().forEach | 96,689,456 Ops/sec |
| With Iteration and Assignment | 94,440,928 Ops/sec |
| With Object.assign() | 12,746,640 Ops/sec |