Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Linux
Desktop
5 months ago
Test name Executions per second
spread ... 51866872.0 Ops/sec
slice() 68519360.0 Ops/sec
splice(0) 44574624.0 Ops/sec
concat() 54174704.0 Ops/sec
JSON.parse(JSON.stringify()) 3000445.5 Ops/sec
Custom function 2299768.8 Ops/sec
Lodash.cloneDeep() 1815927.6 Ops/sec
jQuery.extend(true) 1634966.8 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)