Tests:
  • start

    AخA
     
    const array = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
    const copy = [ 0, ...array ]
  • end

     
    const array = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
    const copy = [ ...array, 0 ]
  • push

     
    const array = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
    const copy = array.slice(0)
    copy.push(0)
  • unshift

     
    const array = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
    const copy = array.slice(0)
    copy.unshift(0)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    start
    end
    push
    unshift

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
Chrome 80 on Windows
View result in a separate tab
Test name Executions per second
start 30541832.0 Ops/sec
end 30668118.0 Ops/sec
push 33615096.0 Ops/sec
unshift 11475182.0 Ops/sec