Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0
Firefox 92
Ubuntu
Desktop
3 years ago
Test name Executions per second
Using the spread operator 2263646.2 Ops/sec
Using Object.assign 2392391.2 Ops/sec
Manually copying properties 13610294.0 Ops/sec
Create new object while copying 145776592.0 Ops/sec
Create new object from scratch 151249168.0 Ops/sec
Tests:
  • Using the spread operator

  • Using Object.assign

  • Manually copying properties

  • Create new object while copying

  • Create new object from scratch