Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Ubuntu
Desktop
4 months ago
Test name Executions per second
spread ... 12334940.0 Ops/sec
slice() 19343726.0 Ops/sec
splice(0) 11719221.0 Ops/sec
concat() 16816650.0 Ops/sec
JSON.parse(JSON.stringify()) 1165112.0 Ops/sec
Custom function 1669235.9 Ops/sec
Lodash.cloneDeep() 1111296.0 Ops/sec
jQuery.extend(true) 805629.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)