Script Preparation code:
AخA
 
arr0 = [];
for(var i=0;i<10000;i++){
  arr0.push("var "+i);
}
Tests:
  • slice

     
    var other = arr0.slice()
  • push-apply

     
    var other = [];
    Array.prototype.push.apply(other, arr0);
  • the ...operator

     
    var other = [...arr0];
  • for-push

     
    var other = [];
    for(var i=0;i<arr0.length;i++){
      other.push(arr0[i]);
    }
  • concat

     
    var other = [];
    other = other.concat(arr0);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    slice
    push-apply
    the ...operator
    for-push
    concat

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93 on Ubuntu
View result in a separate tab
Test name Executions per second
slice 11879.8 Ops/sec
push-apply 6931.0 Ops/sec
the ...operator 2230.7 Ops/sec
for-push 2406.2 Ops/sec
concat 3903.3 Ops/sec