Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Linux
Desktop
one year ago
Test name Executions per second
spread ... 12144066.0 Ops/sec
slice() 16784482.0 Ops/sec
splice(0) 10921102.0 Ops/sec
concat() 11987699.0 Ops/sec
JSON.parse(JSON.stringify()) 704088.4 Ops/sec
Custom function 728145.9 Ops/sec
Lodash.cloneDeep() 645449.2 Ops/sec
jQuery.extend(true) 580741.8 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)