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
11 months ago
Test name Executions per second
spread ... 14534176.0 Ops/sec
slice() 13268750.0 Ops/sec
splice(0) 11043981.0 Ops/sec
concat() 12335782.0 Ops/sec
JSON.parse(JSON.stringify()) 952672.8 Ops/sec
Custom function 837741.8 Ops/sec
Lodash.cloneDeep() 596991.9 Ops/sec
jQuery.extend(true) 564584.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)