Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
append 1949221.6 Ops/sec
splice 1581938.8 Ops/sec
reverse 1254433.9 Ops/sec
concat 1663004.1 Ops/sec
unshift 2064346.6 Ops/sec
Script Preparation code:
AخA
 
l = 123;
Tests:
  • append

     
    a = Array(l);
    a.push(3);
  • splice

     
    a = Array(l);
    a.splice(0,0,3);
  • reverse

     
    a = Array(l);
    a.reverse().push(3);
    a.reverse();
  • concat

     
    a = Array(l);
    a = [3].concat(a);
  • unshift

     
    a = Array(l);
    a.unshift(3);