Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
spread ... 12043764.0 Ops/sec
slice() 12166622.0 Ops/sec
splice(0) 5067375.5 Ops/sec
concat() 3363211.8 Ops/sec
JSON.parse(JSON.stringify()) 467275.5 Ops/sec
Custom function 411307.5 Ops/sec
Lodash.cloneDeep() 472448.6 Ops/sec
jQuery.extend(true) 367139.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)


;