freeCodeCamp/guide/english/certifications/javascript-algorithms-and-d.../basic-javascript/concatenating-strings-with-.../index.md

12 lines
535 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Concatenating Strings with the Plus Equals Operator
---
## Concatenating Strings with the Plus Equals Operator
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
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!"