Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/128 Version/11.1.1 Safari/605.1.15
Safari 11
Mac OS X 10.15.7
Desktop
3 months ago
Test name Executions per second
spread ... 20542842.0 Ops/sec
slice() 17320036.0 Ops/sec
splice(0) 9631871.0 Ops/sec
concat() 6740985.5 Ops/sec
JSON.parse(JSON.stringify()) 1083564.1 Ops/sec
Custom function 940064.2 Ops/sec
Lodash.cloneDeep() 1005978.0 Ops/sec
jQuery.extend(true) 870168.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)