Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0
Firefox 123
Ubuntu
Desktop
7 months ago
Test name Executions per second
spread ... 18446114.0 Ops/sec
slice() 32184242.0 Ops/sec
splice(0) 17823440.0 Ops/sec
concat() 27335176.0 Ops/sec
JSON.parse(JSON.stringify()) 1654731.2 Ops/sec
Custom function 2529006.5 Ops/sec
Lodash.cloneDeep() 1455852.0 Ops/sec
jQuery.extend(true) 1152416.0 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)