Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36
Chrome 88
Mac OS X 11.1.0
Desktop
4 years ago
Test name Executions per second
Array.prototype.push 12645371.0 Ops/sec
Index write 7468793.0 Ops/sec
Script Preparation code:
AخA
 
var arr = [1, 1, 1, 1, 1];
Tests:
  • Array.prototype.push

     
    arr.push(1);
  • Index write

     
    arr[arr.length] = 1;