Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Chrome 79
Windows
Desktop
one year ago
Test name Executions per second
spread ... 19509766.0 Ops/sec
slice() 18603750.0 Ops/sec
splice(0) 15671965.0 Ops/sec
concat() 5715115.5 Ops/sec
JSON.parse(JSON.stringify()) 693287.5 Ops/sec
Custom function 840060.7 Ops/sec
Lodash.cloneDeep() 892574.5 Ops/sec
jQuery.extend(true) 621741.4 Ops/sec
HTML Preparation code:
Tests:
  • spread ...

  • slice()

  • splice(0)

  • concat()

  • JSON.parse(JSON.stringify())

  • Custom function

  • Lodash.cloneDeep()

  • jQuery.extend(true)