Run details:
Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Firefox 89
Windows 8.1
Desktop
2 years ago
Test name Executions per second
spread ... 6805681.0 Ops/sec
slice() 10763901.0 Ops/sec
splice(0) 6167368.5 Ops/sec
concat() 6722434.0 Ops/sec
JSON.parse(JSON.stringify()) 824944.3 Ops/sec
Custom function 417096.7 Ops/sec
Lodash.cloneDeep() 511854.4 Ops/sec
jQuery.extend(true) 337158.3 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)