Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91
Windows
Desktop
2 years ago
Test name Executions per second
spread ... 9100935.0 Ops/sec
slice() 15761422.0 Ops/sec
splice(0) 7834124.0 Ops/sec
concat() 10186210.0 Ops/sec
JSON.parse(JSON.stringify()) 1056880.8 Ops/sec
Custom function 453903.0 Ops/sec
Lodash.cloneDeep() 561933.3 Ops/sec
jQuery.extend(true) 289586.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)