Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Windows
Desktop
one year ago
Test name Executions per second
spread ... 8169487.0 Ops/sec
slice() 13421078.0 Ops/sec
splice(0) 10492174.0 Ops/sec
concat() 13666011.0 Ops/sec
JSON.parse(JSON.stringify()) 494684.4 Ops/sec
Custom function 375592.1 Ops/sec
Lodash.cloneDeep() 306867.8 Ops/sec
jQuery.extend(true) 270517.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)