Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0
Firefox 123
Windows
Desktop
9 months ago
Test name Executions per second
spread ... 7402607.0 Ops/sec
slice() 12358862.0 Ops/sec
splice(0) 6875161.5 Ops/sec
concat() 11627867.0 Ops/sec
JSON.parse(JSON.stringify()) 739132.5 Ops/sec
Custom function 890085.9 Ops/sec
Lodash.cloneDeep() 560409.8 Ops/sec
jQuery.extend(true) 438658.5 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)