Test name | Executions per second |
---|---|
slice | 11879.8 Ops/sec |
push-apply | 6931.0 Ops/sec |
the ...operator | 2230.7 Ops/sec |
for-push | 2406.2 Ops/sec |
concat | 3903.3 Ops/sec |
arr0 = [];
for(var i=0;i<10000;i++){
arr0.push("var "+i);
}
var other = arr0.slice()
var other = [];
Array.prototype.push.apply(other, arr0);
var other = [arr0];
var other = [];
for(var i=0;i<arr0.length;i++){
other.push(arr0[i]);
}
var other = [];
other = other.concat(arr0);