Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110
Windows
Desktop
one year ago
Test name Executions per second
spread ... 8572537.0 Ops/sec
slice() 13579337.0 Ops/sec
splice(0) 8335863.0 Ops/sec
concat() 9940867.0 Ops/sec
JSON.parse(JSON.stringify()) 1008600.2 Ops/sec
Custom function 1276901.5 Ops/sec
Lodash.cloneDeep() 786867.2 Ops/sec
jQuery.extend(true) 416378.3 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)