Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
spread ... 25087568.0 Ops/sec
slice() 27951584.0 Ops/sec
splice(0) 20555526.0 Ops/sec
concat() 27290696.0 Ops/sec
JSON.parse(JSON.stringify()) 1127429.5 Ops/sec
Custom function 893949.4 Ops/sec
Lodash.cloneDeep() 753183.1 Ops/sec
jQuery.extend(true) 663915.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)