Script Preparation code:
AخA
 
var limit = 1000
var a = new Array(limit).fill(limit);
Tests:
  • Array.prototype.slice

     
    var b = a.slice();
    b.unshift(limit);
  • spread operator

     
    var b = [ limit, ...a ];
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.prototype.slice
    spread operator

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array.prototype.slice 1045389.1 Ops/sec
spread operator 191126.2 Ops/sec