Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Linux
Desktop
2 years ago
Test name Executions per second
spread ... 22546512.0 Ops/sec
slice() 28878256.0 Ops/sec
splice(0) 19219620.0 Ops/sec
concat() 23103954.0 Ops/sec
JSON.parse(JSON.stringify()) 876975.9 Ops/sec
Custom function 740357.4 Ops/sec
Lodash.cloneDeep() 658218.4 Ops/sec
jQuery.extend(true) 418188.6 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)