Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Linux
Desktop
2 years ago
Create new object while copying
258.5M/s
Create new object from scratch
250.9M/s
Manually copying properties
51.3M/s
Using Object.assign
18.4M/s
Using the spread operator
8.5M/s
View exact numbers
Test name Executions per second
Create new object while copying 258,482,368 Ops/sec
Create new object from scratch 250,854,224 Ops/sec
Manually copying properties 51,300,896 Ops/sec
Using Object.assign 18,443,850 Ops/sec
Using the spread operator 8,546,423 Ops/sec
Tests: