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

448 B

title localeTitle
Concatenating Strings with the Plus Equals Operator 使用Plus Equals运算符连接字符串

使用Plus Equals运算符连接字符串

'+ ='运算符可以轻松地连接(链接)字符串。确保你的拼写正确,并且你留下了适当的空格。

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