Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0
Firefox 97
Linux
Desktop
2 years ago
Test name Executions per second
spread ... 5184619.5 Ops/sec
slice() 11873684.0 Ops/sec
splice(0) 5327624.0 Ops/sec
concat() 6961470.5 Ops/sec
JSON.parse(JSON.stringify()) 687534.4 Ops/sec
Custom function 734379.8 Ops/sec
Lodash.cloneDeep() 437421.7 Ops/sec
jQuery.extend(true) 368892.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)