HTML Preparation code:
x
 
1
<script src="
2
https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js
3
"></script>
4
Script Preparation code:
 
var arr1 = ["what", "is", "this"];
var arr2 = ["this", "is", "a", "test", "hello", "how", "are", "you", "today"];
Tests:
  • Array.prototype.concat

     
    var result = arr1.concat(arr2);
  • Lodash concat

     
    var result = _.concat(arr1, arr2);
  • Array.prototype.push.apply()

     
    Array.prototype.push.apply(arr1, arr2);
  • spread operator

     
    var result = [arr1, ...arr2]
  • cached for + push

     
    for (var i = 0, l = arr2.length; i < l; i++) {
      arr1.push(arr2[i])
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.prototype.concat
    Lodash concat
    Array.prototype.push.apply()
    spread operator
    cached for + push

    Fastest: N/A

    Slowest: N/A

Latest run results:

No previous run results

This benchmark does not have any results yet. Be the first one to run it!