Script Preparation code:
AخA
 
var arr = []
Tests:
  • .unshift()

     
    for (var i = 0; i < 1000000; i++) {
      arr.unshift(42)
    }
  • .push()

     
    for (var i = 0; i < 1000000; i++) {
      arr.push(42)
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    .unshift()
    .push()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0
Firefox 92 on Linux
View result in a separate tab
Test name Executions per second
.unshift() 0.4 Ops/sec
.push() 23.6 Ops/sec