Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36
Chrome 99
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
spread ... 23290340.0 Ops/sec
slice() 24762394.0 Ops/sec
splice(0) 16843596.0 Ops/sec
concat() 21866052.0 Ops/sec
JSON.parse(JSON.stringify()) 679584.1 Ops/sec
Custom function 569316.8 Ops/sec
Lodash.cloneDeep() 526515.0 Ops/sec
jQuery.extend(true) 337065.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)