Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
Firefox 116
Windows
Desktop
one year ago
Test name Executions per second
spread ... 22348736.0 Ops/sec
slice() 34191940.0 Ops/sec
splice(0) 18703688.0 Ops/sec
concat() 25548680.0 Ops/sec
JSON.parse(JSON.stringify()) 2013311.5 Ops/sec
Custom function 2758992.5 Ops/sec
Lodash.cloneDeep() 1586724.0 Ops/sec
jQuery.extend(true) 1198272.8 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)