Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 OPR/91.0.4516.77
Opera 91
Windows
Desktop
2 years ago
Test name Executions per second
spread ... 46394440.0 Ops/sec
slice() 47884736.0 Ops/sec
splice(0) 37073012.0 Ops/sec
concat() 40041396.0 Ops/sec
JSON.parse(JSON.stringify()) 1425582.6 Ops/sec
Custom function 1172249.5 Ops/sec
Lodash.cloneDeep() 1100023.0 Ops/sec
jQuery.extend(true) 815159.1 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)