Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138
Windows
Desktop
one year ago
Benchmark.js
object.assign
6.9M/s
without immutable
4.9M/s
create new object with assign
1.6M/s
spread
305K/s
View exact numbers
Test name Executions per second
object.assign 6,901,060 Ops/sec
without immutable 4,871,261 Ops/sec
create new object with assign 1,558,425 Ops/sec
spread 304,576 Ops/sec
Script Preparation code:
Tests: