Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Chrome 104
Linux
Desktop
2 years ago
Test name Executions per second
spread ... 44465068.0 Ops/sec
slice() 55860204.0 Ops/sec
splice(0) 34926492.0 Ops/sec
concat() 50516720.0 Ops/sec
JSON.parse(JSON.stringify()) 1421944.6 Ops/sec
Custom function 1135609.6 Ops/sec
Lodash.cloneDeep() 933552.8 Ops/sec
jQuery.extend(true) 891892.5 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)