Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
spread ... 19788404.0 Ops/sec
slice() 25279648.0 Ops/sec
splice(0) 18298200.0 Ops/sec
concat() 29023772.0 Ops/sec
JSON.parse(JSON.stringify()) 2401986.8 Ops/sec
Custom function 3527810.5 Ops/sec
Lodash.cloneDeep() 1762112.5 Ops/sec
jQuery.extend(true) 1202255.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)