Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Windows
Desktop
5 months ago
Test name Executions per second
spread ... 22246604.0 Ops/sec
slice() 44717084.0 Ops/sec
splice(0) 21543060.0 Ops/sec
concat() 33803532.0 Ops/sec
JSON.parse(JSON.stringify()) 2052118.6 Ops/sec
Custom function 3163452.2 Ops/sec
Lodash.cloneDeep() 1596627.6 Ops/sec
jQuery.extend(true) 1379565.5 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)