Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.44
Chrome 95
Windows
Desktop
3 years ago
Test name Executions per second
slice 18452778.0 Ops/sec
splice 7257675.0 Ops/sec
pop 31758084.0 Ops/sec
unshift 13313474.0 Ops/sec
Tests:
  • slice

    AخA
     
    const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'];
    const sliced = rainbow.slice(4,1)
  • splice

     
    const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'];
    const spliced = rainbow.splice(4,1)
  • pop

     
    const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'];
    const popped = rainbow.pop()
  • unshift

     
    const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'];
    const unshifted = rainbow.unshift()