Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0
Firefox 82
Linux
Desktop
4 years ago
Test name Executions per second
Array clone with spread operator 30015800.0 Ops/sec
Array clone with slice 18075970.0 Ops/sec
Array addition with spread operator 17071106.0 Ops/sec
Array addition with slice and push 16863518.0 Ops/sec
Array removal with spread operator 5350897.0 Ops/sec
Array removal with slice and splice 7181566.5 Ops/sec
Array update with spread operator 4846191.5 Ops/sec
Script Preparation code:
Tests:
  • Array clone with spread operator

  • Array clone with slice

  • Array addition with spread operator

  • Array addition with slice and push

  • Array removal with spread operator

  • Array removal with slice and splice

  • Array update with spread operator