Direct concatenation | var foo = arr[0] + arr[1] + arr[2] + arr[3];
| ready |
Individual += statements | var foo = str1;
foo += arr[0];
foo += arr[1];
foo += arr[2];
foo += arr[3];
foo += arr[4];
foo += arr[5];
foo += arr[6];
foo += arr[7];
foo += arr[8];
foo += arr[9];
foo += arr[10];
foo += arr[11];
foo += arr[12];
foo += arr[13];
foo += arr[14];
foo += arr[15];
foo += arr[16];
foo += arr[17];
foo += arr[18];
foo += arr[19];
foo += arr[20];
foo += arr[21];
foo += arr[22];
foo += arr[23];
foo += arr[24];
foo += arr[25];
foo += arr[26];
foo += arr[27];
foo += arr[28];
foo += arr[29];
foo += arr[30];
foo += arr[31];
foo += arr[32];
foo += arr[33];
foo += arr[34];
foo += arr[35];
foo += arr[36];
foo += arr[37];
foo += arr[38];
foo += arr[39];
foo += arr[40];
foo += arr[41];
foo += arr[42];
foo += arr[43];
foo += arr[44];
foo += arr[45];
foo += arr[46];
foo += arr[47];
foo += arr[48];
foo += arr[49];
foo += arr[50];
foo += arr[51];
foo += arr[52];
foo += arr[53];
foo += arr[54];
foo += arr[55];
foo += arr[56];
foo += arr[57];
foo += arr[58];
foo += arr[59];
foo += arr[60];
foo += arr[61];
foo += arr[62];
foo += arr[63];
foo += arr[64];
foo += arr[65];
foo += arr[66];
foo += arr[67];
foo += arr[68];
foo += arr[69];
foo += arr[70];
foo += arr[71];
foo += arr[72];
foo += arr[73];
foo += arr[74];
foo += arr[75];
foo += arr[76];
foo += arr[77];
foo += arr[78];
foo += arr[79];
foo += arr[80];
foo += arr[81];
foo += arr[82];
foo += arr[83];
foo += arr[84];
foo += arr[85];
foo += arr[86];
foo += arr[87];
foo += arr[88];
foo += arr[89];
foo += arr[90];
foo += arr[91];
foo += arr[92];
foo += arr[93];
foo += arr[94];
foo += arr[95];
foo += arr[96];
foo += arr[97];
foo += arr[98];
foo += arr[99];
| ready |
Individual statements | var foo = str1;
foo = foo + arr[0];
foo = foo + arr[1];
foo = foo + arr[2];
foo = foo + arr[3];
foo = foo + arr[4];
foo = foo + arr[5];
foo = foo + arr[6];
foo = foo + arr[7];
foo = foo + arr[8];
foo = foo + arr[9];
foo = foo + arr[10];
foo = foo + arr[11];
foo = foo + arr[12];
foo = foo + arr[13];
foo = foo + arr[14];
foo = foo + arr[15];
foo = foo + arr[16];
foo = foo + arr[17];
foo = foo + arr[18];
foo = foo + arr[19];
foo = foo + arr[20];
foo = foo + arr[21];
foo = foo + arr[22];
foo = foo + arr[23];
foo = foo + arr[24];
foo = foo + arr[25];
foo = foo + arr[26];
foo = foo + arr[27];
foo = foo + arr[28];
foo = foo + arr[29];
foo = foo + arr[30];
foo = foo + arr[31];
foo = foo + arr[32];
foo = foo + arr[33];
foo = foo + arr[34];
foo = foo + arr[35];
foo = foo + arr[36];
foo = foo + arr[37];
foo = foo + arr[38];
foo = foo + arr[39];
foo = foo + arr[40];
foo = foo + arr[41];
foo = foo + arr[42];
foo = foo + arr[43];
foo = foo + arr[44];
foo = foo + arr[45];
foo = foo + arr[46];
foo = foo + arr[47];
foo = foo + arr[48];
foo = foo + arr[49];
foo = foo + arr[50];
foo = foo + arr[51];
foo = foo + arr[52];
foo = foo + arr[53];
foo = foo + arr[54];
foo = foo + arr[55];
foo = foo + arr[56];
foo = foo + arr[57];
foo = foo + arr[58];
foo = foo + arr[59];
foo = foo + arr[60];
foo = foo + arr[61];
foo = foo + arr[62];
foo = foo + arr[63];
foo = foo + arr[64];
foo = foo + arr[65];
foo = foo + arr[66];
foo = foo + arr[67];
foo = foo + arr[68];
foo = foo + arr[69];
foo = foo + arr[70];
foo = foo + arr[71];
foo = foo + arr[72];
foo = foo + arr[73];
foo = foo + arr[74];
foo = foo + arr[75];
foo = foo + arr[76];
foo = foo + arr[77];
foo = foo + arr[78];
foo = foo + arr[79];
foo = foo + arr[80];
foo = foo + arr[81];
foo = foo + arr[82];
foo = foo + arr[83];
foo = foo + arr[84];
foo = foo + arr[85];
foo = foo + arr[86];
foo = foo + arr[87];
foo = foo + arr[88];
foo = foo + arr[89];
foo = foo + arr[90];
foo = foo + arr[91];
foo = foo + arr[92];
foo = foo + arr[93];
foo = foo + arr[94];
foo = foo + arr[95];
foo = foo + arr[96];
foo = foo + arr[97];
foo = foo + arr[98];
foo = foo + arr[99];
| ready |
Using Array#join | var foo = arr.join('');
| ready |
Single individual statement | var foo = str1;
foo += str2 + str3 + str4;
| ready |
Function based (for) | function concat(arr) {
len = arr.length;
for (s = "", i = 0; i < len; s += arr[i], i++);
return s;
}
var foo = concat(arr);
| ready |
concat | var foo = str1;
foo = foo.concat(str2);
foo = foo.concat(str3);
foo = foo.concat(str4);
| ready |
concat once | var foo = str1.concat(str2, str3, str4)
| ready |