Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Mobile Safari/537.36
Chrome Mobile 121
Android
Mobile
10 months ago
Test name Executions per second
spread ... 20248152.0 Ops/sec
slice() 25389454.0 Ops/sec
splice(0) 18773016.0 Ops/sec
concat() 23270434.0 Ops/sec
JSON.parse(JSON.stringify()) 1035621.1 Ops/sec
Custom function 789212.8 Ops/sec
Lodash.cloneDeep() 674467.0 Ops/sec
jQuery.extend(true) 596928.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)