Tests:
  • Array.prototype.concat

    AخA
     
    const arr1 = [ { name: 'hello', id: '1' }, { name: 'hi', id: '2' }, { name: 'welcome', id: '100' } ];
    const arr2 = [ { name: 'o wow', id: '7' }, { name: 'greetings', id: '69' } ].concat(arr1);
  • spread operator

     
    const arr1 = [ { name: 'hello', id: '1' }, { name: 'hi', id: '2' }, { name: 'welcome', id: '100' } ];
    const arr2 = [ { name: 'o wow', id: '7' }, { name: 'greetings', id: '69' }, ...arr1 ];
  • Push

     
    const arr1 = [ { name: 'hello', id: '1' }, { name: 'hi', id: '2' }, { name: 'welcome', id: '100' } ];
    const arr2 = arr1.slice();
    arr2.push(1);
    arr2.push(2);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
Chrome 79 on Mac OS X 10.14.6
View result in a separate tab
Test name Executions per second
Array.prototype.concat 4353354.5 Ops/sec
spread operator 12507246.0 Ops/sec
Push 15740506.0 Ops/sec