Run details:
Mozilla/5.0 (Linux; Android 11; SM-N975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Mobile Safari/537.36
Chrome Mobile 93
Android
Mobile
3 years ago
Test name Executions per second
unshift 1417.5 Ops/sec
push + reverse 1962.4 Ops/sec
Script Preparation code:
AخA
 
var arr = [10];
Tests:
  • unshift

     
    for (let i = 0; i < 10; i++){
      arr.unshift(i);
    }
  • push + reverse

     
    for (let i = 0; i < 10; i++){
      arr.push(i);
    }
    arr.reverse();