Skip to content

Instantly share code, notes, and snippets.

@robotlolita
Created October 3, 2010 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robotlolita/608771 to your computer and use it in GitHub Desktop.
Save robotlolita/608771 to your computer and use it in GitHub Desktop.
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