Append to string variable

Ronal picture Ronal · Aug 17, 2009 · Viewed 425.4k times · Source

How can I append a word to an already populated string variable with spaces?

Answer

karim79 picture karim79 · Aug 17, 2009

Like this:

var str = 'blah blah blah';
str += ' blah';

str += ' ' + 'and some more blah';