Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0
Firefox 116
Ubuntu
Desktop
one year ago
Test name Executions per second
spread ... 6103873.5 Ops/sec
slice() 11150538.0 Ops/sec
splice(0) 6577965.0 Ops/sec
concat() 10114699.0 Ops/sec
JSON.parse(JSON.stringify()) 745503.4 Ops/sec
Custom function 1048523.8 Ops/sec
Lodash.cloneDeep() 382987.4 Ops/sec
structuredClone 219602.5 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • structuredClone


;