Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100
Windows
Desktop
2 years ago
Test name Executions per second
spread ... 1031138.1 Ops/sec
slice() 4711739.5 Ops/sec
splice(0) 4379721.0 Ops/sec
concat() 4457115.0 Ops/sec
JSON.parse(JSON.stringify()) 480444.2 Ops/sec
Custom function 352324.7 Ops/sec
Lodash.cloneDeep() 82140.8 Ops/sec
jQuery.extend(true) 74357.3 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)


;