Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0
Firefox 120
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
spread ... 21896920.0 Ops/sec
slice() 25963832.0 Ops/sec
splice(0) 15105662.0 Ops/sec
concat() 22910824.0 Ops/sec
JSON.parse(JSON.stringify()) 2277066.5 Ops/sec
Custom function 3747543.0 Ops/sec
Lodash.cloneDeep() 1834147.2 Ops/sec
jQuery.extend(true) 1253268.6 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)