Tests:
  • Array.prototype.slice

    AخA
     
    var params = [ "hello", true, 7 ];
    var other = [ 1, 2 ].slice();
  • spread operator

     
    var params = [ "hello", true, 7 ]
    var other = [ ...params ]
  • copy

     
        var params = [ "hello", true, 7 ]
        var other = [];
        for (i = 0; i < 3; i++) {
          other[i] = params[i];
        }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.47
Chrome 117 on Windows
View result in a separate tab
Test name Executions per second
Array.prototype.slice 233041392.0 Ops/sec
spread operator 130726608.0 Ops/sec
copy 83076456.0 Ops/sec