Run details:
Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/119.0.6045.163 Mobile DuckDuckGo/5 Safari/537.36
Chrome Mobile 119
Android
Mobile
one year ago
Test name Executions per second
Array.prototype.concat 5603967.5 Ops/sec
spread operator 27408372.0 Ops/sec
Push 26065006.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 ].push(...params);