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 ... 20288662.0 Ops/sec
slice() 28481836.0 Ops/sec
splice(0) 19708102.0 Ops/sec
concat() 27297188.0 Ops/sec
JSON.parse(JSON.stringify()) 1715353.2 Ops/sec
Custom function 2350009.0 Ops/sec
Lodash.cloneDeep() 1413594.6 Ops/sec
jQuery.extend(true) 1028089.9 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)