Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.50
Chrome 113
Windows
Desktop
one year ago
Test name Executions per second
spread ... 30269374.0 Ops/sec
slice() 35552444.0 Ops/sec
splice(0) 24703390.0 Ops/sec
concat() 30356006.0 Ops/sec
JSON.parse(JSON.stringify()) 1219258.1 Ops/sec
Custom function 1013556.5 Ops/sec
Lodash.cloneDeep() 885881.5 Ops/sec
jQuery.extend(true) 849631.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)