Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Windows
Desktop
2 months ago
Test name Executions per second
spread ... 16087870.0 Ops/sec
slice() 29144524.0 Ops/sec
splice(0) 15756242.0 Ops/sec
concat() 23272356.0 Ops/sec
JSON.parse(JSON.stringify()) 1523304.1 Ops/sec
Custom function 2269751.5 Ops/sec
Lodash.cloneDeep() 1189770.0 Ops/sec
jQuery.extend(true) 1059769.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)