Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox 121
Mac OS X 10.15
Desktop
9 months ago
Test name Executions per second
spread ... 22289592.0 Ops/sec
slice() 26225306.0 Ops/sec
splice(0) 15276729.0 Ops/sec
concat() 23075928.0 Ops/sec
JSON.parse(JSON.stringify()) 2388878.5 Ops/sec
Custom function 3507550.8 Ops/sec
Lodash.cloneDeep() 1759881.9 Ops/sec
jQuery.extend(true) 1689817.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)