Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Firefox 120
Windows
Desktop
one year ago
Test name Executions per second
spread ... 9399305.0 Ops/sec
slice() 16153926.0 Ops/sec
splice(0) 9720098.0 Ops/sec
concat() 14083988.0 Ops/sec
JSON.parse(JSON.stringify()) 1036734.8 Ops/sec
Custom function 1513363.4 Ops/sec
Lodash.cloneDeep() 848145.3 Ops/sec
jQuery.extend(true) 693838.9 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)