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 Edg/113.0.1774.57
Chrome 113
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
spread ... 60084052.0 Ops/sec
slice() 75300696.0 Ops/sec
splice(0) 46840316.0 Ops/sec
concat() 64529892.0 Ops/sec
JSON.parse(JSON.stringify()) 1932643.6 Ops/sec
Custom function 1966093.6 Ops/sec
Lodash.cloneDeep() 1692657.6 Ops/sec
jQuery.extend(true) 1613214.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)