Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Windows
Desktop
one year ago
Test name Executions per second
spread ... 22251080.0 Ops/sec
slice() 33855810.0 Ops/sec
splice(0) 18555780.0 Ops/sec
concat() 30871260.0 Ops/sec
JSON.parse(JSON.stringify()) 1968376.0 Ops/sec
Custom function 2858348.0 Ops/sec
Lodash.cloneDeep() 1499786.0 Ops/sec
jQuery.extend(true) 1203472.0 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)