Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
Chrome 94
Windows 7
Desktop
5 months ago
Test name Executions per second
spread ... 20407638.0 Ops/sec
slice() 21999266.0 Ops/sec
splice(0) 15499895.0 Ops/sec
concat() 21497498.0 Ops/sec
JSON.parse(JSON.stringify()) 727334.1 Ops/sec
Custom function 645915.7 Ops/sec
Lodash.cloneDeep() 590426.4 Ops/sec
jQuery.extend(true) 442654.9 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)