HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var array1 = (new Array(10000)).fill(Math.random(), 0, 9999);
var array2 = (new Array(10000)).fill(Math.random(), 0, 9999);
Tests:
  • Array.prototype.concat

     
    var other = array1.concat(array2);
  • spread operator

     
    var other = [ ...array1, ...array2 ]
  • Lodash merge

     
    var other = _.merge([], array1, array2);
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: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
Firefox 79 on Windows
View result in a separate tab
Test name Executions per second
Array.prototype.concat 2990.7 Ops/sec
spread operator 2668.6 Ops/sec
Lodash merge 213.4 Ops/sec