Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Linux
Desktop
one year ago
Test name Executions per second
spread ... 2797858.2 Ops/sec
slice() 31097608.0 Ops/sec
splice(0) 19621834.0 Ops/sec
concat() 26796454.0 Ops/sec
JSON.parse(JSON.stringify()) 1013994.9 Ops/sec
Custom function 1040257.6 Ops/sec
Lodash.cloneDeep() 883865.8 Ops/sec
jQuery.extend(true) 778799.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)


;