Test name | Executions per second |
---|---|
push | 841.0 Ops/sec |
cp | 2.0 Ops/sec |
var someBigArray = [];
var anotherArray = [];
for (var i = 0; i < 10000; i++) {
someBigArray.push(10);
anotherArray.push(10);
}
anotherArray.forEach(function(item) {
someBigArray.push(item);
})
var cp = someBigArray.slice(0);
anotherArray.forEach(function(item) {
cp.push(item);
})