Skip to content

Challenge Constructing Strings with Variables

SaintPeter edited this page · 1 revision
Clone this wiki locally

Constructing Strings with Variables

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?";
Something went wrong with that request. Please try again.