Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Chrome 113
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
spread ... 60984924.0 Ops/sec
slice() 72800776.0 Ops/sec
splice(0) 49006220.0 Ops/sec
concat() 67296096.0 Ops/sec
JSON.parse(JSON.stringify()) 2326379.5 Ops/sec
Custom function 2476288.8 Ops/sec
Lodash.cloneDeep() 1818985.2 Ops/sec
jQuery.extend(true) 1877427.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)