Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36
Chrome 86
Mac OS X 10.15.7
Desktop
4 years ago
Test name Executions per second
Array clone with spread operator 13020896.0 Ops/sec
Array clone with slice 14970861.0 Ops/sec
Array addition with spread operator 5314723.0 Ops/sec
Array addition with slice and push 5188541.5 Ops/sec
Array removal with spread operator 3268775.0 Ops/sec
Array removal with slice and splice 6220190.5 Ops/sec
Array update with spread operator 2308135.8 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