Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Windows
Desktop
one year ago
Test name Executions per second
spread ... 26471730.0 Ops/sec
slice() 28656736.0 Ops/sec
splice(0) 20149208.0 Ops/sec
concat() 26108170.0 Ops/sec
JSON.parse(JSON.stringify()) 1084727.0 Ops/sec
Custom function 804020.1 Ops/sec
Lodash.cloneDeep() 728397.4 Ops/sec
jQuery.extend(true) 632118.8 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)