Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0
Firefox 118
Windows
Desktop
one year ago
Test name Executions per second
spread ... 12147294.0 Ops/sec
slice() 17069788.0 Ops/sec
splice(0) 12591088.0 Ops/sec
concat() 14716266.0 Ops/sec
JSON.parse(JSON.stringify()) 1242695.1 Ops/sec
Custom function 1758039.9 Ops/sec
Lodash.cloneDeep() 980438.4 Ops/sec
jQuery.extend(true) 811086.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)