Object.assign vs Object.freeze

one month ago
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Test name Executions per second
Object.assign 2470100.0 Ops/sec
Object.freeze 3499806.0 Ops/sec
Script Preparation code:
Tests:
  • Object.assign

  • Object.freeze

Open this result on MeasureThat.net