Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Mac OS X 10.15.7
Desktop
22 days ago
Test name Executions per second
spread ... 37999640.0 Ops/sec
slice() 48561112.0 Ops/sec
splice(0) 30999464.0 Ops/sec
concat() 40992964.0 Ops/sec
JSON.parse(JSON.stringify()) 3808846.8 Ops/sec
Custom function 3528027.8 Ops/sec
Lodash.cloneDeep() 1559343.1 Ops/sec
jQuery.extend(true) 1776052.0 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)