Concatenation vs Array Join

JavaScript performance comparison

Revision 13 of this test case created by Rita

Preparation code

  var str, str1, 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
for (i = 0; i < 10; i++) {
 str += 'a';
var tmp = [];
for (j = 0; j < 10; 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:

1 comment

Jesús commented :

See also . Revision 5 has more ways to do that

Comment form temporarily disabled.

Add a comment