Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128
Windows
Desktop
3 months ago
Test name Executions per second
spread ... 29263836.0 Ops/sec
slice() 33649884.0 Ops/sec
splice(0) 24171136.0 Ops/sec
concat() 30539164.0 Ops/sec
JSON.parse(JSON.stringify()) 1526628.6 Ops/sec
Custom function 1051043.1 Ops/sec
Lodash.cloneDeep() 904441.0 Ops/sec
jQuery.extend(true) 821689.5 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)