Run details:
Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Windows 8
Desktop
one year ago
Test name Executions per second
spread ... 4646420.5 Ops/sec
slice() 5916003.0 Ops/sec
splice(0) 4088198.5 Ops/sec
concat() 5464185.5 Ops/sec
JSON.parse(JSON.stringify()) 154667.0 Ops/sec
Custom function 132224.4 Ops/sec
Lodash.cloneDeep() 113237.4 Ops/sec
jQuery.extend(true) 76291.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)