Concatenation vs Array Join

JavaScript performance comparison

Revision 16 of this test case created by Andrew Barrett

Preparation code

  var i, j;

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
var str = '';
for (i = 0; i < 10000; i++) {
 str += 'a';
var tmp = [], str2 = '';
for (j = 0; j < 10000; j++) {
str2 = tmp.join('');

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


affiliate marketing commented :

What's up Dear, are you really visiting this web site on a regular basis, if so afterward you will without doubt get pleasant experience.

gossard bras online commented :

I constantly spent my half an hour to read this web site's articles every day along with a mug of coffee.

Comment form temporarily disabled.

Add a comment