Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15
Safari 16
Mac OS X 10.15.7
Desktop
2 years ago
Using the spread operator with two extra variables
21.4M/s
Using the spread operator with constant inside
21.1M/s
Using Object.assign
11.9M/s
Using the spread operator
11.2M/s
View exact numbers
Test name Executions per second
Using the spread operator with two extra variables 21,383,294 Ops/sec
Using the spread operator with constant inside 21,107,032 Ops/sec
Using Object.assign 11,931,876 Ops/sec
Using the spread operator 11,151,515 Ops/sec
Tests: