Script Preparation code:
AخA
 
var arrayX = [];
for(i=0; i< 1000; i++){
  arrayX.push(Math.random());
  arrayX.push(Math.random() + 'x');
  arrayX.push(Math.random() > 0.5);
}
Tests:
  • Array.prototype.slice

     
    const copy = arrayX.slice();
  • spread operator

     
    const copy = [ ...arrayX ];
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: 5 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0
Firefox 69 on Mac OS X 10.14
View result in a separate tab
Test name Executions per second
Array.prototype.slice 34623.1 Ops/sec
spread operator 22666.0 Ops/sec