Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
Firefox 100
Windows
Desktop
2 years ago
Test name Executions per second
spread ... 12838238.0 Ops/sec
slice() 20030124.0 Ops/sec
splice(0) 9684395.0 Ops/sec
concat() 12362724.0 Ops/sec
JSON.parse(JSON.stringify()) 1171868.4 Ops/sec
Custom function 1153150.9 Ops/sec
Lodash.cloneDeep() 740154.5 Ops/sec
jQuery.extend(true) 642183.5 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)