Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0
Firefox 98
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
spread ... 9847443.0 Ops/sec
slice() 17808842.0 Ops/sec
splice(0) 9118110.0 Ops/sec
concat() 11002176.0 Ops/sec
JSON.parse(JSON.stringify()) 1305752.5 Ops/sec
Custom function 1148952.6 Ops/sec
Lodash.cloneDeep() 763377.6 Ops/sec
jQuery.extend(true) 695376.6 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)