Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
spread ... 65436980.0 Ops/sec
slice() 87729432.0 Ops/sec
splice(0) 53954808.0 Ops/sec
concat() 76603736.0 Ops/sec
JSON.parse(JSON.stringify()) 2906402.2 Ops/sec
Custom function 2665638.0 Ops/sec
Lodash.cloneDeep() 1936542.4 Ops/sec
jQuery.extend(true) 2027244.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)