Test name | Executions per second |
---|---|
Array.prototype.concat | 6449475.0 Ops/sec |
spread operator twice | 19386722.0 Ops/sec |
Push | 20228150.0 Ops/sec |
var arr1 = [ "the", "quick", "brown", "fox", "jumps" ];
var arr2 = [ "over", "the", "lazy", "dog" ];
var other = arr1.concat(arr2);
var arr1 = [ "the", "quick", "brown", "fox", "jumps" ];
var arr2 = [ "over", "the", "lazy", "dog" ];
var other = [ arr1, arr2 ];
var arr1 = [ "the", "quick", "brown", "fox", "jumps" ];
var arr2 = [ "over", "the", "lazy", "dog" ];
var other = arr1.push(arr2);