Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Windows
Desktop
21 days ago
Test name Executions per second
spread ... 25043338.0 Ops/sec
slice() 22742646.0 Ops/sec
splice(0) 13615347.0 Ops/sec
concat() 18590854.0 Ops/sec
JSON.parse(JSON.stringify()) 2423226.8 Ops/sec
Custom function 1510538.8 Ops/sec
Lodash.cloneDeep() 315960.9 Ops/sec
jQuery.extend(true) 314925.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)