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 ]
  • Push operation

     
    var other = []
    arr.forEach(el => other.push(el))
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15
Safari 17 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array.prototype.slice 172210.7 Ops/sec
spread operator 107884.9 Ops/sec
Push operation 29459.6 Ops/sec