Run details:
Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Mobile Safari/537.36
Chrome Mobile 103
Android
Mobile
2 years ago
Test name Executions per second
Array.prototype.concat 4332729.5 Ops/sec
spread operator 21281884.0 Ops/sec
Push 18580752.0 Ops/sec
Tests:
  • Array.prototype.concat

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

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

     
    var params = [ "hello", true, 7 ];
    var other = [ 1, 2 ];
    other.forEach((item) => {
        other.push(item);
    });