Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0
Firefox 130
Linux
Desktop
3 months ago
Test name Executions per second
spread ... 14387197.0 Ops/sec
slice() 20408052.0 Ops/sec
splice(0) 14831326.0 Ops/sec
concat() 19195220.0 Ops/sec
JSON.parse(JSON.stringify()) 1392873.9 Ops/sec
Custom function 1883880.0 Ops/sec
Lodash.cloneDeep() 1114870.9 Ops/sec
jQuery.extend(true) 1007332.7 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)