freeCodeCamp/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator/index.md
2018-10-16 21:32:40 +05:30

535 B

title
Concatenating Strings with the Plus Equals Operator

Concatenating Strings with the Plus Equals Operator

The '+=' operator can concatenate (link) strings easily. Make sure your spelling is right, and you've left appropriate spaces.

var str = "Hello ";
str += "coding"; // Now the string reads "Hello coding"
str += "camper!"; // And now the string reads "Hello codingcamper!"