freeCodeCamp Challenge Guide: Constructing Strings with Variables

freeCodeCamp Challenge Guide: Constructing Strings with Variables
0

#1

Sometimes you will need to build a string, Mad Libs style. By using the concatenation operator +, you can insert one or more variables into a string you’re building.

Example

var ourName = "Free Code Camp";
var ourStr = "Hello, our name is " + ourName + ", how are you?";

#2

var myName = “Kumar”;
var myStr = "My name is " + myName + “and I am swell!”;

you can set your name in myName variable


#3