Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108
Linux
Desktop
9 months ago
Test name Executions per second
spread ... 39978688.0 Ops/sec
slice() 40162144.0 Ops/sec
splice(0) 29412262.0 Ops/sec
concat() 35341524.0 Ops/sec
JSON.parse(JSON.stringify()) 1285832.9 Ops/sec
Custom function 1039056.7 Ops/sec
Lodash.cloneDeep() 939002.6 Ops/sec
jQuery.extend(true) 743602.9 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)