Script Preparation code:
x
 
random = () => Array(50).fill(Math.floor(Math.random() * 9))
arr1 = random();
arr2 = random();
Tests:
  • Array.prototype.concat

     
    const other = arr1.concat(arr2);
  • spread operator

     
    const other = [ ...arr1, ...arr2]
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.prototype.concat
    spread operator

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
Chrome 84 on Windows 7
View result in a separate tab
Test name Executions per second
Array.prototype.concat 270875.9 Ops/sec
spread operator 179211.3 Ops/sec