Combining Strings

var str1="jQuery"; var str2=" & "; var str3="JavaScript"; var str4 = str1.concat(str2, str3); //str5 = "jQuery & JavaScript" var str5 = str4 + " Phrasebook";    //str5 = "jQuery & JavaScript Phrasebook"

You can combine multiple strings using the .concat(str, str, ...) method. Or you can just use the str + str + str . . . method.

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.