Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Firefox 122
Windows
Desktop
10 months ago
Test name Executions per second
spread ... 11503841.0 Ops/sec
slice() 16850182.0 Ops/sec
splice(0) 11948769.0 Ops/sec
concat() 16326650.0 Ops/sec
JSON.parse(JSON.stringify()) 1183063.2 Ops/sec
Custom function 1685651.9 Ops/sec
Lodash.cloneDeep() 1017108.5 Ops/sec
jQuery.extend(true) 783690.6 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)