Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Chrome 112
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
Spread operator (...) 4809.6 Ops/sec
JSON.parse(JSON.stringify()) 23.0 Ops/sec
Custom function 41.6 Ops/sec
Lodash.cloneDeep() 3660.6 Ops/sec
jQuery.extend(true) 3814.9 Ops/sec
structuredClone() 2309.7 Ops/sec
HTML Preparation code:
Tests:
  • Spread operator (...)

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)

  • structuredClone()