filmov
tv
Basic JavaScript (29/111) | Appending Variables to Strings | freeCodeCamp
![preview_player](https://i.ytimg.com/vi/6LOwe55Xqj0/sddefault.jpg)
Показать описание
Basic JavaScript (29/111) | Appending Variables to Strings | freeCodeCamp
Just as we can build a string over multiple lines out of string literals, we can also append variables to a string using the plus equals (+=) operator.
Example:
var anAdjective = "awesome!";
var ourStr = "freeCodeCamp is ";
ourStr += anAdjective;
// ourStr is now "freeCodeCamp is awesome!"
Set someAdjective and append it to myStr using the += operator.
Just as we can build a string over multiple lines out of string literals, we can also append variables to a string using the plus equals (+=) operator.
Example:
var anAdjective = "awesome!";
var ourStr = "freeCodeCamp is ";
ourStr += anAdjective;
// ourStr is now "freeCodeCamp is awesome!"
Set someAdjective and append it to myStr using the += operator.