Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108
Windows
Desktop
2 years ago
Test name Executions per second
spread ... 18012430.0 Ops/sec
slice() 19943208.0 Ops/sec
splice(0) 14379204.0 Ops/sec
concat() 1182553.0 Ops/sec
JSON.parse(JSON.stringify()) 597026.6 Ops/sec
Custom function 481299.5 Ops/sec
Lodash.cloneDeep() 463391.2 Ops/sec
jQuery.extend(true) 368479.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)