--- id: 56533eb9ac21ba0edf2244b7 title: Concatenating Strings with Plus Operator challengeType: 1 --- ## Description
In JavaScript, when the + operator is used with a String value, it is called the concatenation operator. You can build a new string out of other strings by concatenating them together. Example
'My name is Alan,' + ' I concatenate.'
Note
Watch out for spaces. Concatenation does not add spaces between concatenated strings, so you'll need to add them yourself.
## Instructions
Build myStr from the strings "This is the start. " and "This is the end." using the + operator.
## Tests
```yml - text: myStr should have a value of This is the start. This is the end. testString: 'assert(myStr === "This is the start. This is the end.", ''myStr should have a value of This is the start. This is the end.'');' - text: Use the + operator to build myStr testString: 'assert(code.match(/(["'']).*(["''])\s*\+\s*(["'']).*(["''])/g).length > 1, ''Use the + operator to build myStr'');' - text: myStr should be created using the var keyword. testString: 'assert(/var\s+myStr/.test(code), ''myStr should be created using the var keyword.'');' - text: Make sure to assign the result to the myStr variable. testString: 'assert(/myStr\s*=/.test(code), ''Make sure to assign the result to the myStr variable.'');' ```
## Challenge Seed
```js // Example var ourStr = "I come first. " + "I come second."; // Only change code below this line var myStr; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js var ourStr = "I come first. " + "I come second."; var myStr = "This is the start. " + "This is the end."; ```