Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Chrome 131
Windows
Desktop
one month ago
Test name Executions per second
spread ... 38093368.0 Ops/sec
slice() 43413920.0 Ops/sec
splice(0) 29530878.0 Ops/sec
concat() 32021260.0 Ops/sec
JSON.parse(JSON.stringify()) 1861201.9 Ops/sec
Custom function 1312338.4 Ops/sec
Lodash.cloneDeep() 1087561.1 Ops/sec
jQuery.extend(true) 1043240.7 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)