Run details:
Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0
Firefox 102
Windows
Desktop
2 years ago
Test name Executions per second
spread ... 13277590.0 Ops/sec
slice() 20580282.0 Ops/sec
splice(0) 8990543.0 Ops/sec
concat() 10509754.0 Ops/sec
JSON.parse(JSON.stringify()) 1280346.1 Ops/sec
Custom function 1340381.1 Ops/sec
Lodash.cloneDeep() 1004714.3 Ops/sec
jQuery.extend(true) 881256.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)