Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15
Safari 16
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
spread ... 28191736.0 Ops/sec
slice() 25721216.0 Ops/sec
splice(0) 16835440.0 Ops/sec
concat() 12185199.0 Ops/sec
JSON.parse(JSON.stringify()) 1885993.6 Ops/sec
Custom function 1501985.4 Ops/sec
Lodash.cloneDeep() 1564585.8 Ops/sec
jQuery.extend(true) 1468541.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)