Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Mac OS X 10.15.7
Desktop
10 months ago
Test name Executions per second
spread ... 24232540.0 Ops/sec
slice() 26521964.0 Ops/sec
splice(0) 17848126.0 Ops/sec
concat() 21943176.0 Ops/sec
JSON.parse(JSON.stringify()) 1391925.6 Ops/sec
Custom function 1033019.1 Ops/sec
Lodash.cloneDeep() 853576.7 Ops/sec
jQuery.extend(true) 846863.6 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)