Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15
Safari 17
Mac OS X 10.15.7
Desktop
3 months ago
Test name Executions per second
spread ... 25791594.0 Ops/sec
slice() 21696644.0 Ops/sec
splice(0) 14547287.0 Ops/sec
concat() 9881104.0 Ops/sec
JSON.parse(JSON.stringify()) 1707639.8 Ops/sec
Custom function 1391286.0 Ops/sec
Lodash.cloneDeep() 1444146.5 Ops/sec
jQuery.extend(true) 898274.9 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)