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 ]
    copy.push(0)
  • unshift

     
    const array = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
    const copy = [ ...array ]
    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 29369862.0 Ops/sec
end 32132396.0 Ops/sec
push 31634164.0 Ops/sec
unshift 10861999.0 Ops/sec