Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0
Firefox 124
Ubuntu
Desktop
8 months ago
Test name Executions per second
spread ... 15058681.0 Ops/sec
slice() 29405720.0 Ops/sec
splice(0) 20286938.0 Ops/sec
concat() 27482884.0 Ops/sec
JSON.parse(JSON.stringify()) 1971605.4 Ops/sec
Custom function 3106034.2 Ops/sec
Lodash.cloneDeep() 1958767.4 Ops/sec
jQuery.extend(true) 1589734.8 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)


;