Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
Chrome 102
Linux
Desktop
2 years ago
Test name Executions per second
spread ... 3186631.0 Ops/sec
slice() 30398108.0 Ops/sec
splice(0) 24723592.0 Ops/sec
concat() 31898402.0 Ops/sec
JSON.parse(JSON.stringify()) 1007761.6 Ops/sec
Custom function 840739.6 Ops/sec
Lodash.cloneDeep() 714852.2 Ops/sec
jQuery.extend(true) 540722.8 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)