Script Preparation code:
AخA
 
var arr = Array.from({length: 10000}, () => Math.random())
Tests:
  • Array.prototype.slice

     
    var other =  arr.slice();
  • spread operator

     
    var other = [ ...arr ]
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: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Firefox 134 on Windows
View result in a separate tab
Test name Executions per second
Array.prototype.slice 20620.1 Ops/sec
spread operator 4422.7 Ops/sec