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 ... 19718968.0 Ops/sec
slice() 29927328.0 Ops/sec
splice(0) 18601190.0 Ops/sec
concat() 28317902.0 Ops/sec
JSON.parse(JSON.stringify()) 1656644.6 Ops/sec
Custom function 2653897.5 Ops/sec
Lodash.cloneDeep() 1458733.4 Ops/sec
jQuery.extend(true) 1108713.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)