Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Firefox 108
Windows
Desktop
2 years ago
Test name Executions per second
spread ... 3859623.2 Ops/sec
slice() 10632311.0 Ops/sec
splice(0) 5754353.0 Ops/sec
concat() 6214080.0 Ops/sec
JSON.parse(JSON.stringify()) 668111.8 Ops/sec
Custom function 745238.3 Ops/sec
Lodash.cloneDeep() 557782.8 Ops/sec
jQuery.extend(true) 386745.6 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)