Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var arr = []; var x = [];
for (var i = 0; i < 100; ++i) { x [i] = i };
var d = +new Date;
for (var i = 0; i < 1000; ++i) {
arr = arr.concat(x);
}
console.log(+new Date - d);
var d = +new Date;
for (var i = 0; i < 1000; ++i) {
arr.push.apply(arr, x);
}
console.log(+new Date - d);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment