Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100
Linux
Desktop
2 years ago
Test name Executions per second
spread ... 10261856.0 Ops/sec
slice() 10399823.0 Ops/sec
splice(0) 7693146.5 Ops/sec
concat() 10080351.0 Ops/sec
JSON.parse(JSON.stringify()) 416890.8 Ops/sec
Custom function 338473.1 Ops/sec
Lodash.cloneDeep() 279721.5 Ops/sec
jQuery.extend(true) 191839.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)