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

     
    var params = [ "hello", true, 7 ];
    var other = [ 1, 2 ].concat(params);
  • spread operator

     
    var params = [ "hello", true, 7 ]
    var other = [ ...[1, 2], ...params ]
  • Lodash merge

     
    var params = [ "hello", true, 7 ];
    var other = _.merge([], [1, 2], params);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Chrome 71 on Windows
View result in a separate tab
Test name Executions per second
Array.prototype.concat 3217234.2 Ops/sec
spread operator 9709545.0 Ops/sec
Lodash merge 212867.8 Ops/sec