Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Windows
Desktop
5 months ago
Test name Executions per second
spread ... 29324226.0 Ops/sec
slice() 30583190.0 Ops/sec
splice(0) 25640536.0 Ops/sec
concat() 29165274.0 Ops/sec
JSON.parse(JSON.stringify()) 1628823.6 Ops/sec
Custom function 1117497.5 Ops/sec
Lodash.cloneDeep() 958030.9 Ops/sec
jQuery.extend(true) 784805.2 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)


;