String Concatenation Operators
Concatenation
let text1 = "Good";
let text2 = "Morning";
let text3 = text1 + " " + text2;
Try it Yourself »let text2 = "Morning";
let text3 = text1 + " " + text2;
JavaScript String Operators
The + operator, and the += operator can also be used to concatenate (add) strings.
Given thatt1 = "Good ",t2 = "Morning",and t3 = "", the table below explains the operators:
| Oper | Example | t1 | t2 | t3 | Try it |
|---|---|---|---|---|---|
| + | t3 = t1 + t2 | "Good " | "Morning" | "Good Morning" | Try it » |
| += | t1 += t2 | "Good Morning" | "Morning" | Try it » |
For a tutorial about assignment operators, read ourJavaScript Assignment Tutorial.
Learn More:
Browser Support
String Concatenation is an ECMAScript1 (JavaScript 1997) feature.
It is supported in all browsers:
| Chrome | Edge | Firefox | Safari | Opera |

