Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Linux
Desktop
10 months ago
Test name Executions per second
spread ... 46229224.0 Ops/sec
slice() 40272312.0 Ops/sec
splice(0) 30642664.0 Ops/sec
concat() 34947592.0 Ops/sec
JSON.parse(JSON.stringify()) 1991799.5 Ops/sec
Custom function 1594192.2 Ops/sec
Lodash.cloneDeep() 1337114.1 Ops/sec
jQuery.extend(true) 1232593.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)