Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91
Linux
Desktop
one year ago
Test name Executions per second
spread ... 9619066.0 Ops/sec
slice() 14344141.0 Ops/sec
splice(0) 6299814.5 Ops/sec
concat() 8671351.0 Ops/sec
JSON.parse(JSON.stringify()) 1094506.5 Ops/sec
Custom function 509004.3 Ops/sec
Lodash.cloneDeep() 712051.4 Ops/sec
jQuery.extend(true) 308553.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)