Tests:
  • Array.prototype.concat

    AخA
     
    var arr1 = [ "the", "quick", "brown", "fox", "jumps" ];
    var arr2 = [ "over", "the", "lazy", "dog" ];
    var other = arr1.concat(arr2);
  • spread operator twice

     
    var arr1 = [ "the", "quick", "brown", "fox", "jumps" ];
    var arr2 = [ "over", "the", "lazy", "dog" ];
    var other = [ ...arr1, ...arr2 ];
  • Push

     
    var arr1 = [ "the", "quick", "brown", "fox", "jumps" ];
    var arr2 = [ "over", "the", "lazy", "dog" ];
    var other = arr1.push(...arr2);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

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

    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/123.0.0.0 Safari/537.36
Chrome 123 on Windows
View result in a separate tab
Test name Executions per second
Array.prototype.concat 9130439.0 Ops/sec
spread operator twice 25110960.0 Ops/sec
Push 32211366.0 Ops/sec