Array#concat vs Array#push

Edit on GitHub

Array.concat vs Array.push

Setup

var array1 = Array.apply(undefined, {length: 23});
var array2 = Array.apply(undefined, {length: 230});

Tests

  • Array#concat

    var array1 = Array.apply(undefined, {length: 23});
    var array2 = Array.apply(undefined, {length: 230});
    
    array1 = array1.concat(array2);
  • Array#push

    var array1 = Array.apply(undefined, {length: 23});
    var array2 = Array.apply(undefined, {length: 230});
    
    Array.prototype.push.apply(array1, array2);