Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Windows
Desktop
6 months ago
Test name Executions per second
spread ... 24948756.0 Ops/sec
slice() 31139224.0 Ops/sec
splice(0) 19981598.0 Ops/sec
concat() 24507118.0 Ops/sec
JSON.parse(JSON.stringify()) 1279917.5 Ops/sec
Custom function 859361.0 Ops/sec
Lodash.cloneDeep() 773706.7 Ops/sec
jQuery.extend(true) 650089.0 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)