Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
spread ... 56948668.0 Ops/sec
slice() 79848408.0 Ops/sec
splice(0) 47391680.0 Ops/sec
concat() 69808616.0 Ops/sec
JSON.parse(JSON.stringify()) 2832569.8 Ops/sec
Custom function 2423054.5 Ops/sec
Lodash.cloneDeep() 1732932.1 Ops/sec
jQuery.extend(true) 1826825.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)


;