String Concat += | var html_a = [],
html_s = '';
html_s += '<div>Div #' + 1 + '</div>';
html_s += '<div>Div #' + 2 + '</div>';
html_s += '<div>Div #' + 3 + '</div>';
html_s += '<div>Div #' + 4 + '</div>';
html_s += '<div>Div #' + 5 + '</div>';
| ready |
Array Push Multiple | var html_a = [],
html_s = '';
html_a.push('<div>Div #', 1, '</div>');
html_a.push('<div>Div #', 2, '</div>');
html_a.push('<div>Div #', 3, '</div>');
html_a.push('<div>Div #', 4, '</div>');
html_a.push('<div>Div #', 5, '</div>');
html_s = html_a.join('');
| ready |
Array Push Single | var html_a = [],
html_s = '';
html_a.push('<div>Div #');
html_a.push(1);
html_a.push('</div>');
html_a.push('<div>Div #');
html_a.push(2);
html_a.push('</div>');
html_a.push('<div>Div #');
html_a.push(3);
html_a.push('</div>');
html_a.push('<div>Div #');
html_a.push(4);
html_a.push('</div>');
html_a.push('<div>Div #');
html_a.push(5);
html_a.push('</div>');
html_s = html_a.join('');
| ready |
String Concat x = x + y + z | var html_a = [],
html_s = '';
html_s = '<div>Div #' + 1 + '</div>' + '<div>Div #' + 2 + '</div>' + '<div>Div #' + 3 + '</div>' + '<div>Div #' + 4 + '</div>' + '<div>Div #' + 5 + '</div>';
| ready |
Sring Concat x = x + y | var html_a = [],
html_s = '';
html_s = '<div>Div #' + 1 + '</div>';
html_s = html_s + '<div>Div #' + 2 + '</div>';
html_s = html_s + '<div>Div #' + 3 + '</div>';
html_s = html_s + '<div>Div #' + 4 + '</div>';
html_s = html_s + '<div>Div #' + 5 + '</div>';
| ready |
Array literal | var html_a = [],
html_s = [
'<div>Div #',
1,
'</div>',
'<div>Div #',
2,
'</div>',
'<div>Div #',
3,
'</div>',
'<div>Div #',
4,
'</div>',
'<div>Div #',
5,
'</div>'
].join("");
| ready |