HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js'></script>
Tests:
  • Array.prototype.concat

     
    const params = [ { id: `2` }, { id: `3` }, { id: `4` } ];
    const other = [ { id: `1` } ].concat(params);
  • Lodash concat

     
    const params = [ { id: `2` }, { id: `3` }, { id: `4` } ];
    const other = _.concat([ { id: `1` } ], params);
  • Array spread

     
    const params = [ { id: `2` }, { id: `3` }, { id: `4` } ];
    const other = [ { id: `1` }, ...params ];
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
Chrome 89 on Windows
View result in a separate tab
Test name Executions per second
Array.prototype.concat 6693155.0 Ops/sec
Lodash concat 1930905.9 Ops/sec
Array spread 41807216.0 Ops/sec