Tests:
  • for() method copy

    x
     
    let arr1 = [1,2,3,4,5,6,7,8,9,10];
    let arr2 = [];
    for (let i=0; i<arr1.length; i+=1) {arr2.push(arr1[i]);}
  • spread operator copy

     
    let arr1 = [1,2,3,4,5,6,7,8,9,10];
    let arr2 = [...arr1];
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    for() method copy
    spread operator copy

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Chrome 127 on Windows
View result in a separate tab
Test name Executions per second
for() method copy 44548492.0 Ops/sec
spread operator copy 92735944.0 Ops/sec